Reuse Image Descriptions in WP Gutenberg

R

Since 2018 or before, WordPress users have commented on the workflow for adding new images to WordPress and how the description/alt tag is saved. Users questioned if it was a bug that when you upload an image directly to a Gutenberg post the image is directly added and saved to the post, bypassing the Media Library dialog with Attachment Details and global description field. Commenters shared that the behavior made it significantly more challenging to maintain an accessible and valuable media library.

Issue and WP Core Response

The WordPress Core team responded that the behavior was as expected. Here’s their response.


GitHub Gutenburg Issues post: Alt text added to Image Settings in Image block is not retained for reuse. 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.


How to Add an Image Description from a Page or Post to both the Media Library and Page at the Same Time

So, here’s the workaround for wanting to add the Image Description directly to the Media Library rather than just the post, which leaves the description in the media gallery blank. There’s three simple steps.

1. Use Media Library to Upload

Choose Media library for your post's image upload option to add Alt Text to the Media Library and Post
Choose “Media Library” for your post’s image upload option to add Alt Text to the Media Library and Post at the same time.

2. Choose Upload files and Select

Choose upload files tab and select

3. Add your Media Gallery Alt Description

Add your alt text in the media library
Screenshot

To note, per page or post, the field is called Alternative Text (where as in the Media Library it is called Alt text) and is found in the Block section.

Where you add Alternative Text per post. Select your image and look in the Block Tab to the right. Block > Settings > Alternative Text
This image shows where you add Alternative Text per post. Select your image and look in the Block Tab to the right. Block > Settings > Alternative Text

Watch Video on How to Reuse Image Descriptions in WordPress Gutenberg

Hello, so what I’m going to show you is a workaround that

is from a post that people have

been commenting on since 2018,

and it’s about your alt text not saving outside of the library and how you would upload image in Gutenberg.

So here’s how it works. If I click to upload an image,

most of us are going to use the blue upload button.

When we upload an image,

and it loads,

right here in our post we put in the alternative

text. So I’m just going to say “post text” so that you can see

that. Alright, so the problem is if I

now come to my Media Library and I look at that image,

the Alt text is blank,

and many people have said that this is frustrating, and

that this feels broken. If this image is reused in

another post, it’s going to come in blank and someone might not expect that and

which would be better having an image without an alternative text or

as the WordPress core has talked about,

if they filled this alternative text here,

now it is encouraging that the text is the same on multiple pages and

really the intent of that alt text is that it is unique per- post.

So the workaround of how you can

in one swoop get your post alt

text created and also your media library text created.

It is if you click image and this time choose media library

instead of the upload button. From media library click your

upload files tab and this time select your file.

From here you’re given the alt text and this is actually in your media

library. So I can say, “media library text”

so that you can see that. Now I’m going to choose select.

Now you can see, from this upload option,

now it automatically fills in on my post the alternative

text that I added to the media library. So I can still edit it

here to be post specific. So I can say post specific text.

I’m going to save my draft. This time when I come into my media library

you will be able to see that this image kept the original

upload text which I put into the media library and I was

able to edit it and change it. For the use case of the specific

post. Alright, so that’s the trick and the workaround to

be able to upload an image to a specific post and

be able to make your description

automatically populate in your media library and in your page.

Alright, I hope this tip helps.

Happy WordPressing!

About the author

Kelly Barkhurst

Designer to Fullstack is my place to geek out and share tech solutions from my day-to-day as a graphic designer, programmer, and business owner (portfolio). I also write on Arts and Bricks, a parenting blog and decal shop that embraces my family’s love of Art and LEGO bricks!

Add comment

Recent Posts

Archives

Categories