Title: HTML Code Error in Title Attribute Output
Last modified: September 7, 2016

---

# HTML Code Error in Title Attribute Output

 *  Resolved [David Cameron Law](https://wordpress.org/support/users/seo-dave/)
 * (@seo-dave)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/html-code-error-in-title-attribute-output/)
 * Testing your SEO plugin and the output has a major HTML error in the title= output.
 * Where the title is added between img and src in the code, it lacks a space. The
   output is
 * `img title = "phrase here"src`
 * should be
 * `img title = "phrase here" src`
 * There’s a space missing. Also don’t like the spaces around the = signs 🙂
 * Also you are adding the filename as the alt text, this may or may not have SEO
   value, depends on the filename.
 * If we have a file with name randomfhfggfjjfhg.jpg we do not want alt text “randomfhfggfjjfhg”.
   It’s why other similar plugins use the post title.
 * Also found errors on the settings page. Where you’ve disabled features (by breaking
   the code) that are in the Pro version it results in PHP errors. Test your plugin
   with this in your wp-config.php file to see the issue:
 *     ```
       define('WP_DEBUG', true);
       define('WP_DEBUG_DISPLAY', true);
       ```
   
 * David Law

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [webriti](https://wordpress.org/support/users/priyanshumittal/)
 * (@priyanshumittal)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/html-code-error-in-title-attribute-output/#post-8158952)
 * Hi David
 * Including filename in alt and title tags is not mandatory, if you din’t want 
   to show filename in alt and title tags than do not add the name directive in 
   the respective fields. We had developed this feature on user’s request.
 * Regarding spacing and errors, since this forum cannot be used for premium plugin
   support kindly get in touch over our email at themes[at]webriti[dot]com along
   with the email id you used during the time of purchase and the version on which
   you are getting these errors. Because the spacing issue is already fixed in the
   latest version of premium packages , so, kindly share the plugin version.
 * Kindly get in touch on our email.
 * Thanks
    Priyanshu
 *  Thread Starter [David Cameron Law](https://wordpress.org/support/users/seo-dave/)
 * (@seo-dave)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/html-code-error-in-title-attribute-output/#post-8159960)
 * I was testing the free version to see what it does/how it works, your plugin 
   isn’t what I’m looking for (too many code problems, not the right features).
 * Just giving you a friendly heads up of code problems for you to fix for your 
   users. Had I planned to use the plugin I’d fix them myself. The space issue for
   example is a simple case of adding a few spaces in the code.
 * In Version: 1.6.1
    Edit file: seo-optimized-images.php
 * lines 76 and 117 change to
 * `$t_title = 'title = "'.$title_text.'" ';`
 * If like me you don’t like the space before and after the = signs change to
 * `$t_title = 'title="'.$title_text.'" ';`
 * I’d do the same with the “alt = ” output as well. I’d want all the alt code to
   be “alt=”.
 * David Law

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘HTML Code Error in Title Attribute Output’ is closed to new replies.

 * ![](https://ps.w.org/seo-optimized-images/assets/icon-128x128.png?rev=1456929)
 * [Seo Optimized Images](https://wordpress.org/plugins/seo-optimized-images/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/seo-optimized-images/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/seo-optimized-images/)
 * [Active Topics](https://wordpress.org/support/plugin/seo-optimized-images/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/seo-optimized-images/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/seo-optimized-images/reviews/)

## Tags

 * [alt](https://wordpress.org/support/topic-tag/alt/)
 * [images](https://wordpress.org/support/topic-tag/images/)
 * [title](https://wordpress.org/support/topic-tag/title/)

 * 2 replies
 * 2 participants
 * Last reply from: [David Cameron Law](https://wordpress.org/support/users/seo-dave/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/html-code-error-in-title-attribute-output/#post-8159960)
 * Status: resolved