Support » Plugin: Yoast SEO » Change og:image size when using featured image

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    Hello @mario62rus

    Thanks for using the Yoast SEO plugin. Are you having issues with custom Facebook image sizes and og:image tags? The wpseo_opengraph_image_size filter manipulates the image size used for Open Graph sharing.

    In Yoast SEO 20.1, we fixed a bug where the filter is used to set the custom size to og:image but doesn’t work when uploading an image with the same size as the custom size.

    Can you please confirm that you are running Yoast SEO 20.7 and WordPress v6.2?

    • This reply was modified 4 months, 2 weeks ago by Maybellyne.
    • This reply was modified 4 months, 2 weeks ago by Maybellyne.
    Thread Starter Mario62rus

    (@mario62rus)

    I updated WP to version 6.2 and the plugin to the latest version, but this did not solve the problem. I added the following code to the Functions.php file:

    add_filter( ‘wpseo_opengraph_image_size’, function() {
    return ‘medium’;
    });

    But I still see a large image in the “og:image” tag. Page URL: https://gobaku.ru/blog/univerium-raj-dlya-studentov-v-serdtse-baku/ row 48.

    I think this filter does not work when the image is taken from the post featured image..

    Plugin Support Michael Tiña

    (@mikes41720)

    Hi @mario62rus

    If you check the documentation here, there’s a note in the description that you’ll need to reindex the indexables using the Yoast Test Helper plugin or via WP-CLI to see the og:image change in effect for posts created before using the filter. Could you please check and confirm that you’ve done so?

    Thread Starter Mario62rus

    (@mario62rus)

    Thank you, your advice helped!

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.