Understanding the Image Title Attribute

Last Updated on September 16, 2022 by 8 Comments

Understanding the Image Title Attribute
Blog / WordPress / Understanding the Image Title Attribute
Play Button

Optimizing your websiteโ€™s images is no small task. Not only do you need to make sure their file sizes are manageable to prevent long page loading times, but they also present many opportunities to improve your Search Engine Optimization (SEO) that are easy to overlook. For example, you may be unaware of the image title attribute and the role it plays in your siteโ€™s visual elements.

In this post, weโ€™ll shed some light on the image title attribute, discuss how it differs from the alt attribute, and talk about what it means for your SEO strategy. Weโ€™ll also show you how to hide it from your siteโ€™s visitors.

Letโ€™s dive right in!

Subscribe To Our Youtube Channel

An Introduction to the Image Title Attribute

First thingโ€™s first: The image title attribute is not the same as the imageโ€™s file name. Rather, itโ€™s information that can be included in the photo or graphicโ€™s HTML tag. Hereโ€™s an example, with the title attribute at the end:

<img src="filename.jpg" alt="description of your image" title="image title">

The most notable impact the title attribute has is that users can see it as a โ€œtooltipโ€ on the front end of your site when they hover over the image:

An example of an image title attribute tooltip.

Not all browsers support this feature. However, Firefox is one of the few that does, and itโ€™s the third most popular browser on the web. You can add image title attributes in WordPress via your Media Library. Just click on the image in question and fill in the Title field:

Adding an image title attribute in the WordPress Media Library.

You can also add it directly in the Block Editor. Expand the Advanced settings for the image block and fill in the Title Attributeย field:

Adding an image title attribute in the Block Editor.

The purpose of making the image title visible on hover is to provide a bit of additional context for your visitors. For example, some content creators will include the names of the people depicted in the image, or key details users may benefit from knowing.

However, you donโ€™t want to rely on the title attribute exclusively, especially since itโ€™s not visible to users in all browsers. In some cases, a caption might be more effective. Also, you should always be sure to add alt text to your images, even if they have title attributes.

When creating your title attributes, itโ€™s best to keep them to just a few words. Be selective and descriptive so that the hover text is not too long and provides value to your visitors.

The Difference Between the Title Attribute vs. the Alt Attribute

We mentioned earlier that itโ€™s important to add alt text to your images even if youโ€™ve included a title attribute. Itโ€™s a common mistake for content creators to confuse the image title attribute for the alt attribute, or to assume that using both is overkill.

The alt attribute specifies the imageโ€™s alt text in its HTML tag. It is the second attribute listed in our example from before:

<img src="filename.jpg" alt="description of your image" title="image title">

The purpose of alt text is to describe visual elements to users who canโ€™t see them, either because the image failed to load or because they are using a screen reader. This text will be displayed in place of the image in cases when it cannot be rendered:

Alt text displayed in place of an image that is unable to load.

In WordPress, you can add alt text to images via your Media Library or the settings of any image block in the Block Editor. This is key to ensuring your site meets accessibility standards, so we strongly encourage you to do so.

It is extremely important not to attempt to use the image title attribute to replace the alt attribute. Not all screen readers support the title attribute, and thereโ€™s no way for users who rely on keyboard navigation to hover over an image to see it, so this could lead to serious accessibility issues on your site.

How the Image Title Attribute Impacts SEO

Thereโ€™s a lot of mixed messaging when it comes to how important the image title attribute is to SEO. Some claim itโ€™s an excellent way to incorporate additional keywords, while others say search engine bots donโ€™t even crawl it.

To cut to the chase, the image title attribute is not a direct ranking factor. Optimizing your images by adding titles to all of them is probably not going to make a significant change in your pagesโ€™ visibility in search engine results.

However, including title attributes also wonโ€™t hurt your site from an SEO standpoint. In fact, Google recommends it. If search engine bots do crawl them and you incorporate keywords, you may be able to give your images a boost in Google Image search results at least.

Plus, image titles may improve your siteโ€™s User Experience (UX) by sharing key details with visitors. This can contribute indirectly to SEO by influencing ranking factors such as page views, session duration, and other such metrics.

Even so, as weโ€™ve mentioned several times, not all browsers and devices support hover text. Going through your Media Library and adding titles to every file could be a huge waste of time if most of your users will never see it.

How to Hide the Image Title Tooltip in WordPress

You may prefer to hide the image title tooltip. Perhaps youโ€™re concerned visitors will find it annoying, or want to use it primarily for SEO purposes but donโ€™t feel itโ€™s necessary for helping readers understand your content.

You can just remove the title attribute from your images in the Block Editor and your Media Library. However, youโ€™ll then lose any potential SEO benefits you might see from it.

Most people who want to hide the tooltip end up adding JavaScript to their sites so that they can keep the attribute in their image tags but prevent it from displaying on the front end. We recommend using a plugin such as Insert Headers and Footers to make this process easier.

Add the following code in theย <head> section, wrapped in script tags:

jQuery(document).ready(function($) {
    $('img[title]').each(function() { $(this).removeAttr('title'); });
});

If youโ€™re using Divi, you can skip installing the extra plugin and add this code by navigating toย Divi > Theme Options > Integration:

The first code editor on this screen will add the JavaScript to your siteโ€™sย <head> section just like Insert Headers and Footers would.

Conclusion

Itโ€™s possible to create online content for years and never think about your imagesโ€™ title attributes. However, ignoring them completely could be a missed opportunity to provide additional context to your users. More importantly, misusing this attribute could have negative consequences for your siteโ€™s accessibility and SEO.

In this post, we discussed the differences between the image title attribute and the alt attribute so you can maximize your SEO. We also walked you through how to hide the image title tooltip on the front end so visitors canโ€™t see it when they hover over a photo or graphic.

Do you have any questions about the image title attribute or image optimization? Leave them for us in the comments section below!

Image by Jane Kelly / Shutterstock.com

Divi Anniversary Sale

It's The Divi Anniversary Sale! Save Big For A Limited Time ๐Ÿ‘‡

Save big on Divi and Divi products for a limited time.

Access The Sale
Divi Anniversary
Premade Layouts

Check Out These Related Posts

On-Page SEO Checklist (Every Task For New & Existing Pages)

On-Page SEO Checklist (Every Task For New & Existing Pages)

Updated on March 10, 2025 in WordPress

On-page SEO is the foundation of a strong search strategy and the most controllable way to influence a pageโ€™s visibility. It focuses on individual pages of content that are optimized for search engines and users, making it easier to rank and attract organic traffic. From keyword targeting to...

View Full Post
WordPress Security Threat Update (4 Trends in 2025)

WordPress Security Threat Update (4 Trends in 2025)

Posted on March 6, 2025 in WordPress

Many WordPress users rely solely on security plugins for protection. While these plugins add a layer of security, they arenโ€™t often enough to protect your WordPress website completely, especially when cybercriminals are getting smarter. With AI on the rise, hackers can now mass-scan WordPress...

View Full Post

8 Comments

  1. Hi,
    I have added the code but still, it’s displaying on the front end

  2. Trying again: Just what I was looking forโ€ฆ
    However, I added the code to the head section, as a result the header moved a bit lower, tooltips remained.

    • Hi, Matt. I would need some more information to try to help you. How are you adding the code (using Divi, a plugin, or by editing the file directly)? Did you wrap the snippet in script tags?

  3. Just what I was looking for…
    However, I added the code to , as a result the header moved a bit lower, tooltips remained.

  4. I found really nice some sites who give a good title to their images when it was showed as a tooltip. Not necessary but it was a great point. And I wouldn’t be so sure that Robots doesn’t crawl it… maybe the don’t do it the usual way, but if it is something that will be shown on screen, I think they would take it as any other text. But who knows!!

    By the way, I found great that now Divi takes the Alt text settings from the media gallery when you add a photo ๐Ÿ™‚

    • Thanks for your input, Taisa! You’re right that it’s entirely possible that bots might crawl the title attribute โ€“ but since some SEO specialists say they don’t, I felt it was worth mentioning. Glad to hear Divi is working out well for you!

  5. I use my own CustomFunctions.php plugin to add functionality to my site. Is it possible to add that script to that? When it comes to PHP, I’m pretty much a cut-and-paste user (my programming experience is in other languages). So, if it is possible, what would that look like? Thanks!

    • Hi, Bruce! I can’t say for sure if this snippet will work with your plugin, but if you’ve been using it to add code to your site without issue then I’d say there’s no harm in trying it. Just remember you’ll have to wrap the JS in script tags since you’re adding it to a PHP file.

Leave A Reply

Comments are reviewed and must adhere to our comments policy.

๐Ÿ‘‹ It's The Divi
Anniversary Sale!
Get The Deal
Before It's Gone!
Get Started With Divi