Yoast / wordpress-seo

Yoast SEO for WordPress
https://yoast.com/wordpress/plugins/seo/
Other
1.77k stars 894 forks source link

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

Open Telsenome opened 2 years ago

Telsenome commented 2 years ago

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

Djennez commented 2 years ago

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.

g-man-jones commented 2 years ago

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?

prabhoz commented 1 year ago

I am also facing same issue, image is not updating

hakakou commented 1 year ago

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.

wiesty commented 2 months ago

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)