Yoast OpenGraph Featured Image Update Fix ensures that the OpenGraph og:image
tag is always up-to-date with the current featured image, regardless of how the image was changed. This plugin solves the issue where Yoast SEO may not update the og:image
tag if the featured image was modified through methods other than the default WordPress post editor.
Yoast SEO is a powerful tool for managing SEO metadata on your WordPress site, including OpenGraph tags. However, a known issue is that Yoast does not always update the og:image
tag when the featured image is changed via methods other than the standard WordPress post editor. This can lead to outdated or incorrect images being shared on social media platforms, potentially impacting your site's appearance and engagement.
This plugin hooks into the Yoast SEO filters to ensure that the og:image
, og:image:width
, og:image:height
, and og:image:type
tags are dynamically updated based on the current featured image of the post. It does this by:
- Replacing the
og:image
URL: Ensures that the OpenGraph image URL matches the current featured image URL. - Updating the
og:image:width
andog:image:height
tags: Retrieves and sets the correct dimensions of the current featured image. - Setting the
og:image:type
tag: Ensures the MIME type of the image is accurately reflected in the OpenGraph tags.
- Upload the plugin files to the
/wp-content/plugins/yoast-opengraph-featured-image-update-fix
directory, or install the plugin through the WordPress plugins screen directly. - Activate the plugin through the 'Plugins' screen in WordPress.
- Why doesn't Yoast SEO always update the
og:image
tag?
Yoast SEO primarily updates the og:image
tag when changes are made through the WordPress post editor. If the featured image is changed through other methods, such as custom scripts or plugins, Yoast may not detect these changes, leading to outdated og:image
tags.
- How does this plugin ensure the
og:image
tag is correct?
This plugin uses WordPress hooks to dynamically update the og:image
tag and related attributes whenever the OpenGraph metadata is generated, ensuring the tags always reflect the current featured image.
- Is this plugin compatible with all themes and plugins?
This plugin should be compatible with most themes and plugins. However, if you encounter any issues, please report them on the plugin's GitHub repository.
- 1.0.1
- Initial release.