Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#43837 closed enhancement (duplicate)

Make the alt attribute a required field in the Media Library

Reported by: thatdevgirl's profile thatdevgirl Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Media Keywords:
Focuses: accessibility Cc:

Description

The "alt" attribute in the Media Library should be a required field. As of right now, the current workflow for adding an image to the Media Library is:

  1. Upload an image.
  2. Image is saved to the Media Library and automatically given a "title" attribute that is equal to the image's file name. The "alt" attribute is blank on image upload.

The "title" attribute listed in the media library could be used on the front-end as the value of an image's alt value, but "title" and "alt" are really two different things. While both supply descriptive information about an image, the "title" attribute is meant to be short and catchy (like a title should be), while the "alt" attribute is meant to give a full text description of the image to someone who is unable to see the image.

A user can, but is not required, to click into the image to make changes to the image's information. However, in that edit screen, a user can leave both the "title" and "alt" attributes blank.

This is an accessibility concern that violates WCAG 2.0 guideline 1.1.1 (a level A issue): "Non-text Content: All non-text content that is presented to the user has a text alternative that serves the equivalent purpose"

I would like to propose an enhancement to the workflow for uploading images to the Media Library:

  1. Upload an image.
  2. An edit screen appears for each image. Users may make changes to the image's information, including the opportunity to add "alt" text.
  3. User should not be able to save image information (or should be presented with an error) if the "alt" attribute is left blank.

Change History (3)

#1 @thatdevgirl
7 years ago

Another thought: Alt text is not always required, but that is only true if the image is purely decoration (which is usually not the case). Perhaps a checkbox could be added saying "yes, this image really is for decoration only. it doesn't need alt text" - just to force the user to acknowledge that alt text is necessary (most of the time).

#2 @chetan200891
7 years ago

  • Focuses accessibility added

#3 @SergeyBiryukov
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi @thatdevgirl, welcome to WordPress Trac!

Thanks for the ticket, we're already tracking this enhancement in #43380.

Note: See TracTickets for help on using tickets.