How Do You Fix the Gutenberg Image Block title Attribute Display Issue?
We here at Hawp Media really like the Gutenberg update, mainly for the generation of HTML when creating pages. However, there is one rather annoying flaw with a specific block that all SEO’s are wondering about. That is, the image block missing the title tag attribute.
With a small JavaScript code block there is an easy way to fix this and make your titles dynamic, however, it’s limited.
With the script below, you can force all image tags to have title tags that use the same content as the alt tag. This is a good fix.
You might be wondering though, will Google see the tag when it crawls your site? Simple answer: Yes. A more detailed answer can be found on Search Engine Land here: We Tested How Googlebot Crawls Javascript And Here’s What We Learned
We dynamically inserted in the DOM various tags that are critical for SEO: Title elements, Meta descriptions, Meta robots Canonical tags. Result: In all cases the tags were crawled respected, behaving exactly as HTML elements in source code should.
Search Engine Land
Add this to your JavaScript file