Media changes not updating posts

What happens:

  • Write a post
  • Create a gallery
  • Upload a random picture
  • Set caption to test
  • Publish Post
  • Go to Media - Select the picture from before
  • Set caption to changed and save
  • Go back to post
  • Check the image
  • Image caption still shows test - Should be changed

So if I ever update the media library with proper captions, alt text and titles it looks like they will never be updated on older posts. Is this how it should work?

If this is not a bug, but a feature, how to fix this? Where are these block-information on the post saved?

Kind Regards, Ben

Topic media gallery Wordpress

Category Web


I've found a solution to this and created a plugin for the current WordPress Version: https://github.com/DasBen/CasualBen-Automatic-Alt-And-Caption-Text/tree/1.1.0

Everytime an image is rendered, there will now be a query to update alt-text and captions.


Yes, that is Core behavior. The Post Editor saves whatever alt text, caption, and title you use while editing a specific Post/Page/CPT into its post content, in HTML if you are using the Classic Editor, or in Image block attributes if you are using the Block Editor.

One workaround is to always upload media directly to the Media Library. While you upload, set your desired alt text, captions, and titles. After you're done there, edit the Posts/Pages/CPTs where you want to add the images. Since the info is stored in the Media Library, when you add the image to a post's content, that will prepopulate from what you already entered.

If you need to go back and change existing image info in posts, it is probably easiest to follow a similar pattern: set the alt text, captions, and titles in the Media Library first. Then, you'll have to search through your Posts/Pages/CPTs, but you can remove the images there and re-add them, and they'll have the info prepopulated.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.