Opened 5 weeks ago
Last modified 5 days ago
#64501 new enhancement
Consider leaving title field blank as default for images in library
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | 6.9 |
| Component: | Media | Keywords: | close |
| Focuses: | accessibility | Cc: |
Description
There are accessibility issues with using the title tag for images.
Currently, when you upload an image to the media library, the title field always(?) adds a value to the title field, usually the file name.
This post outlines several issues about using the title field for images (especially when the alt tag is empty):
https://www.24a11y.com/2017/the-trials-and-tribulations-of-the-title-attribute/
This leads a11y experts to recommend removing the value of the title field in the WordPress media library as a common best practice.
Also, the title field could be confused with the alt tag. By autofilling the title field, this might lead users to gravitate towards that field and edit that one instead of the alt field.
Attachments (2)
Change History (6)
#1
@
3 weeks ago
The attachment title is usually not shown on the frontend by default. It is mostly used internally- for example, in the Media Library, attachment pages, search, and some admin or API contexts. On the frontend, images generally rely on the URL, alt text, caption, or description, unless a theme or plugin chooses to use the title field.
#3
@
3 weeks ago
- Keywords close added
Populating the Title field is necessary.
If attachment pages are enabled, the Title field is important for use in the page's <title> element.
64501.diff creates errors when uploading because then the $title variable is undefined. If that line sets $title to an empty string instead, the list view of the Media Library would have "(no title)" as the link text for every image uploaded after the change.
The image's Title field is not the same as a title attribute. I'm aware that the Avada theme and WPBakery Page Builder plugin can add title attributes to images on the front end from the Title field, but that is not core usage.
UI of the title field in WordPress media library