website page speed optimization

how to fix “frame or iframe elements do not have a title” error

45 second read.

If you’re losing “Accessibilty” points and are getting the message “<frame> or <iframe> elements do not have a title” error when running a Pagespeed Insights test, you need to add a descriptive title to the <frame> or <iframe> element that accurately reflects the content it contains. The purpose of this is to help search engines and users understand the purpose of the frame, thereby improving the accessibility of the website. Bear in mind that a good title should be concise, relevant, and informative.

As an example if you’ve embedded a Google map, you could simply put “Map of [location name]” or “Get Directions to [location name].” Don’t use a vague or non-descriptive title like “Frame 1” as this doesn’t provide any useful information for the viewer.

Where do I put it?

You should place the title attribute within the <frame> or <iframe> tag. For example:

<iframe src="the-url-of-the-frame" title="Your descriptive title"></iframe>

Make sure you replace the src attribute with the actual URL and the title attribute with a relevant and descriptive title that accurately reflects the content of the iframe and bingo! It’ll now pass the test 🙂