wordpress-seo icon indicating copy to clipboard operation
wordpress-seo copied to clipboard

Not updating the OG:data when adding/removing featured images via other plugins

Open Telsenome opened this issue 4 years ago • 5 comments

  • [x] I've read and understood the contribution guidelines.
  • [x] I've searched for any related issues and avoided creating a duplicate issue.

Please give us a description of what happened.

When altering the featured image of a blogpost in any way (removing/adding/changing) using the plugin Quick Featured Images (https://wordpress.org/plugins/quick-featured-images/) the OG data in Yoast doesn’t update accordingly. So if an image was removed, it will still be present in the OG data until one opens the post and updates it from the standard update button (https://imgur.com/a/upCu6SQ). If the featured image has been changed to a new one the old will be present until the post is updated that way.

I’m talking about these fields (can be seen on on individual posts in the Rest API response): https://imgur.com/a/juys7gV

How can we reproduce this behavior?

  1. Install https://wordpress.org/plugins/quick-featured-images/
  2. Remove/add/change the image on a post using the options the plugin enables (https://i.imgur.com/Koa38ou.png)
  3. Check the OG data in the Rest API response. It won't have updated accordingly.

Technical info

  • WordPress version: 5.8.2
  • Yoast SEO version: 17.5
  • Quick Featured Images version: 13.5.7

Telsenome avatar Nov 26 '21 16:11 Telsenome

Confirmed.

It looks like we don't update indexables when code calls WP functions to update metadata. With one exception being our own post meta, which we watch here.

Because the featured image gets updated with a call to set_post_thumbnail(), which results in a update_metadata(), we might want to look into watching post changes via this route as well.

Djennez avatar Nov 29 '21 07:11 Djennez

I am also finding this a problem as we have a custom interface where a user can change their own featured image using 'set_post_thumbnail()' ... I think you should be watching the post changes there as suggested.

Is there any known work around for this issue currently?

g-man-jones avatar Apr 12 '22 14:04 g-man-jones

I am also facing same issue, image is not updating

prabhoz avatar Apr 21 '23 09:04 prabhoz

Also have this issue. I am trying to update the featured image via the Rest API. After updating, I see correctly the new image in the Wordpress editor (even in the Yoast Section !), however og tags show the old image. I need to manually click the "Update" button in the editor (without actually changing anything) to see updated og tags.

hakakou avatar May 02 '23 18:05 hakakou

Also have this issue. I am trying to update the featured image via the Rest API. After updating, I see correctly the new image in the Wordpress editor (even in the Yoast Section !), however og tags show the old image. I need to manually click the "Update" button in the editor (without actually changing anything) to see updated og tags.

Same, I am trying to update the og image via a php function, it works in the editor even in the yoast section but it does not update the image. (Not even with the "update" button method)

wiesty avatar Sep 03 '24 13:09 wiesty

Came across this and it's sad to see this has not be resolved after a 4 years or so.

Is there a function that we can call to force the update?

gae-rafatjah avatar Aug 12 '25 11:08 gae-rafatjah