gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Alt text added to Image Settings in Image block is not retained for reuse

Open abrightclearweb opened this issue 8 years ago • 8 comments

Describe the bug Uploading an image direct to a Gutenberg post puts the image directly in the post, bypassing the Media Library dialog with Attachment Details.

If you select an image to add from the Media Library, you see the Select or Upload Media screen where the Attachment Details show when you have selected something. There you can add caption, alt text and description which are retained for subsequent usage. If you add alt text here it's copied over to the Alt text box in Image Settings.

For a brand new upload a user won't see the Media Library Attachment Details, so it's logical to add alt text in the Image Settings panel. In that case, it's not saved for reuse.

To Reproduce Steps to reproduce the behavior:

  1. Upload an image to a new post.
  2. Complete Alt text in Image Settings.
  3. Save the post.
  4. Create a new post.
  5. Add the same image to the post.
  6. No Alt text is shown.

Expected behavior I expected that the alt text would be saved for that image for reuse. If I add alt text when uploading an image in the classic editor, the alt text is retained for the next time I use the image.

I could go to the Media Library and edit the image there to add alt text, but that breaks my workflow.

Screenshots

Image uploaded, alt text typed in Image Settings image uploaded and alt text added

Alt text shows in the post alt text on the front end

Image selected for reuse image reselected - no alt text

No alt text :( alt text box is empty

Desktop (please complete the following information):

  • OS: Windows 10 64-bit
  • Browser: Firefox Quantum
  • Version 61.0.1 (64-bit)

Additional context

  • Gutenberg 3.5.0

abrightclearweb avatar Aug 13 '18 19:08 abrightclearweb

This is true for Alt and Caption in v3.7.0 as well. I would also want to update the Description field here.

Desktop (please complete the following information):

OS: OS X High Sierra Browser: Chrome Version 68.0.3440.106 (64-bit)

Additional context

Gutenberg 3.7.0

slattery avatar Sep 07 '18 19:09 slattery

This is still true for Alt and Caption in 4.3

slattery avatar Nov 13 '18 22:11 slattery

This is still true as of Gutenberg 5.1 and WordPress 5.1. It makes it significantly harder to maintain an accessible and useful media library.

#11054 is related in that many of the new image upload flows either don't allow editing image meta or don't sync that meta back to the Media Library. This is going to lead to significantly bloated and unsearchable media libraries.

mrwweb avatar Feb 22 '19 19:02 mrwweb

Still an issue Nov 9, 2019 Gutenberg plugin 6.8.0 WP 5.2.4

kalnode avatar Nov 09 '19 19:11 kalnode

There is a similar Core Trac ticket:

Alt Text Not Saving Outside of Library

The conclusion from the WP Accessibility team was that this works as expected:

This ticket was discussed during today's accessibility bug-scrub. This works as expected but it's clear that the user interface could be more... clear. There's a ticket for that! See #47456.

From https://core.trac.wordpress.org/ticket/47456:

A common misconception is that the image alt text should always be a "description of the image". In most of the cases, this is misleading. Actually, the image alt text needs to describe the purpose of the image in its specific context. For more details, see the W3C Alt Text Decision Tree tutorial (https://www.w3.org/WAI/tutorials/images/decision-tree/).

WordPress stores a "default" alt text in the media object. While storing a default value may help users when they build their content, it also promotes a misunderstanding of the purpose of the alt text.

In the accessibility team, we think this is more an user interface problem rather than a data model problem. The user interface should ensure users clearly understand that alt attributes are context sensitive and that the "default" alt value needs to be changed (or even removed) based on the specific usage.


Please feel free to reopen this issue if the discussion needs to continue.

enriquesanchez avatar Jul 16 '20 20:07 enriquesanchez

WP.. surprises me. Everyone wants to have reusable alt, but can go and f yourself - it's expected) It used to work in old versions, now it's not and it's ok? It was useful for searching old uploaded media at least...

vigilantspb avatar Aug 09 '20 20:08 vigilantspb

Updating my original comment: I agree with the WP Core's reply and the user's complaints. I spent some time troubleshooting this and as an update, I did discover a workaround that allows for a single upload from a post or page that adds the alternative description to both the Library and Post.

When you click to Upload an image, choose the text link that reads "Media Library" instead of using the blue Upload button. Then click the first Tab that reads Upload. When you upload this way, you're uploading directly to the Media Library and can add a Media Library description during the upload process. Then click Select. Your image is added to your post and media library with the same description. If you choose, you can now change your alternative text for just this post's image using the block area.

This is a nice feature. It encourages what the Core team wanted: having users make post-specific alts because most users will use the blue Upload button. It also gives users who want the shared functionality an option to do that, too. Thank you!

kbarkhurst avatar May 09 '24 16:05 kbarkhurst

Hey everyone,

I just ran into this while working on a site and was confused why alt texts set in the media library weren’t showing on the frontend.

I get that alt text should be context-specific. However, in cases where no alt text is set in Gutenberg at all, wouldn’t it be better to fall back to the media library value instead of outputting an empty alt attribute?

A possible approach:

  • If the alt text in Gutenberg is empty → use the media library value
  • If an alt text is explicitly set in Gutenberg → leave it unchanged

This would improve accessibility in cases where alt text is unintentionally missing, without overriding deliberate choices.

samuelmente avatar Apr 28 '26 09:04 samuelmente