Make WordPress Core

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: drw158's profile drw158 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)

screenshot-2025-12-15-at-4.38.23-pm.png (37.7 KB) - added by drw158 5 weeks ago.
UI of the title field in WordPress media library
64501.diff (1.0 KB) - added by tuba121 4 weeks ago.

Download all attachments as: .zip

Change History (6)

@drw158
5 weeks ago

UI of the title field in WordPress media library

@tuba121
4 weeks ago

#1 @tuba121
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.

#2 @drw158
3 weeks ago

Perhaps this is not an issue like I thought it might be. Thank you for clarifying!

#3 @sabernhardt
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.

#4 @poena
5 days ago

I agree with the suggestion to close this.

Note: See TracTickets for help on using tickets.