Jetpack Related Posts - suggested accessibility improvements
Steps to reproduce the issue
- Enable Jetpack Related Posts module.
- Use NVDA screen reader to read out the content in the Related section. I used it on this post: https://www.abrightclearweb.com/accessibility-testing-wordpress-gutenberg-first-look/.
What happened
Because the image link and title link are separate, and both have title attributes, this is what is read out to a screen reader user:
The User Experience and Accessibility of Gutenberg (The WordPress 5.0 Block Editor) graphic visited link The User Experience and Accessibility of Gutenberg (The WordPress 5.0 Block Editor) As WordPress 5.0 launches today, with a new block editor, it seems timely to revisit this presentation I gave at WordCamp Edinburgh 2018 on 17 November. This was the talk description: The new Gutenberg editor is a key part of WordPress 5.0 which is going to change the user experience… The User Experience and Accessibility of Gutenberg (The WordPress 5.0 Block Editor) visited link The User Experience and Accessibility of Gutenberg (The WordPress 5.0 Block Editor) As WordPress 5.0 launches today, with a new block editor, it seems timely to revisit this presentation I gave at WordCamp Edinburgh 2018 on 17 November. This was the talk description: The new Gutenberg editor is a key part of WordPress 5.0 which is going to change the user experience… heading level 4
This is verbose, and duplicates information. It's also two links to tab through instead of one.
Also, the Related is a h3 and post title an h4. On my post, it looks as if the Related part is a subsection of h2 Have your say. If there were no subheadings in this post and just the post title, there would be a skipped heading level.
Suggestions for improvement
Combine the image link and post title link into one link, as suggested here: https://www.w3.org/TR/WCAG20-TECHS/H2.html. Have null alt text on the image (alt=""). Consider not having the post titles as headings - see the Link block level elements with care section of https://www.filamentgroup.com/lab/a11y-links.html.
Remove the title attributes: they are redundant.
Make the Related heading an h2, and the post titles <span>. Adjust CSS as necessary.
This issue has been marked as stale. This happened because:
- It has been inactive in the past 6 months.
- It hasn’t been labeled `[Pri] Blocker`, `[Pri] High`.
No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.
I have opened a PR to make improvements: https://github.com/Automattic/jetpack/pull/16088
It doesn't address all your issues @abrightclearweb as we need to be careful with backwards compatibility. There is a link in the PR which details how to do advanced customisation of the related posts feature. This will help you if you wish to improve things further.