#64501 closed enhancement (invalid)
Consider leaving title field blank as default for images in library
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 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):
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 (8)
#1
@
2 months 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.
#2
@
2 months ago
Perhaps this is not an issue like I thought it might be. Thank you for clarifying!
#3
@
2 months 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 WPBakery Page Builder plugin can add title attributes to images on the front end from the Title field, but that is not core usage.
This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.
11 days ago
#6
@
11 days ago
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
Agree. The "Title" field is a necessary label for identifying images in the media library. In the list view, it's used as the visible title of the media item; and since [r61757], it's also visible in the grid view, to allow voice control users to select images.
WordPress core does not insert title attributes, so anything that is doing so would need an issue opened wherever that is occurring.
Thanks for your concern, however, @drw158!
UI of the title field in WordPress media library