Too many third-party embeds are making this accessibility mistake
People navigating with assistive technology such as a screen reader rely on the title
attribute of an iframe
to understand its content. The title’s value should concisely describe the embedded content:
Without this title, screen readers will instead give information like “frame,” “JavaScript,” the filename, or the URL. In most cases, this information won’t be very helpful. People have to navigate into the iframe
to determine what its embedded content is. This context shift can be confusing and time-consuming, especially if embeds contain interactive content like a video or audio content.
It is a Web Content Accessibility Guidelines (WCAG) 2.2 Success Criteria that an iframe
should have an accessible name i.e. have a title
. The best practice is for each title to be unique and descriptive.
YouTube gives an embed snippet with the title
attribute with a value of ‘YouTube Video Player’. Every single YouTube video will be announced as ‘YouTube Video Player’! 🤨
Codepen’s “HTML (recommended)” snippet contains a script that injects an iframe
into the page. The iframe
produced has a title
attribute with a value of ‘CodePen Embed’.
I informed Codepen who will fix the issue.
I suspect that most auditing tools don’t identify this issue. For example, Lighthouse reports an accessibility issue if an iframe is missing a title. However it does not report an issue if multiple iframes on the same page have the same title. I think it would be helpful if tools picked this up, it would draw attention to embeds that don’t have descriptive titles.
In any case, when you are including embeds in your website, inspect the title
. Aim to have a concise, descriptive, unique title for every iframe on your website.