A question came up during our December 13th WordPress Hartford, CT Meetup about whether or not image titles and descriptions are important for SEO – or even used at all. Here is a check of that. We are using the block editor and the Kadence theme (free version) for this “watch us build it” website.
Use alternate text (alt tag) to efficiently describe the image and use captions if appropriate.
An image with Alt, Caption, Description, and Title
This is what we entered into the media library:
Here is the image inserted into this page:
Here is the resulting HTML code:
<figure class="wp-block-image size-full"><img loading="lazy" width="1024" height="678" src="https://build.hartfordwp.com/wp-content/uploads/2021/12/shiba-inu-in-snow.jpg" alt="Shiba Inu dog on porch in snow" class="wp-image-285" srcset="https://build.hartfordwp.com/wp-content/uploads/2021/12/shiba-inu-in-snow.jpg 1024w, https://build.hartfordwp.com/wp-content/uploads/2021/12/shiba-inu-in-snow-300x199.jpg 300w, https://build.hartfordwp.com/wp-content/uploads/2021/12/shiba-inu-in-snow-768x509.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px"><figcaption><a rel="noreferrer noopener" target="_blank" href="https://www.flickr.com/photos/51869361@N05/25025353786">“Archer – Shiba Inu”</a> by <a rel="noreferrer noopener" href="https://www.flickr.com/photos/51869361@N05" target="_blank">likeaduck</a> is licensed under <a rel="noreferrer noopener" href="https://creativecommons.org/licenses/by/2.0/?ref=openverse&atype=rich" target="_blank">CC BY 2.0</a></figcaption></figure>
Note that the above image was found on Openverse and the rich text creator credit was pasted into the caption section of the image block.
The image was added to the page using the core Image block.
The image Title and Description do not appear in the HTML, only the Alt (alt="Shiba...") and Caption (<figcaption>) appear.
The title attribute can be used within an img HTML tag. It generally will display as a “tool tip” when the site visitor places their cursor over the image. It appears this is not considered best practices for a variety of reasons. WordPress does not include the title attribute when inserting an image.
Use the alt tag/attribute and focus on text that efficiently describes the image to those who cannot see the image.
Use captions for a visible way to describe or provide additional information about the image. Captions are optional, but can provide helpful content and are read by search engines.
Addendum: HTML in caption field in Media Library
The image below was added using the block inserter, selecting an image with HTML links added in caption field when first saved in media library. Recommendation: If you need to add rich text captions (e.g. captions with link), add that caption when inserting the image block in a page or post – it’s cleaner and easier.
Captions and caption styling
Here is a nice link to information on writing image captions:
WordPress Image Captions: A Beginner’s Guide
Styling captions depends on your theme. Some offer options in the customizer, but most rely on custom CSS for styling captions, including Kadence (as far as I can find).