OpenGraph global fallback not working

#400298
  • Resolved Will Etling
    Rank Math free

    I’ve set a global default for OpenGraph image. However, it never works, it continues to pull the first image within the post. I have cleared transients, cleared server cache, cleared browser cache. The RankMath panel in the post editor shows the global default. But the front end of the site never does.

Viewing 1 replies (of 1 total)
  • Anas
    Rank Math business

    Hello,

    Thank you for contacting Rank Math, and sorry for any inconvenience caused.

    The default OpenGraph image is used only when:

    1. You have not uploaded any featured image to the post.

    2. You are not using even a single image inside the post.

    3. You have not added any image to the social tab.

    If you wish to force the use of default social image, please paste this code in your theme’s functions.php file:

    add_filter('rank_math/opengraph/pre_set_content_image', function() {
    	return true;
    });

    Here is a guide you can follow to add the filter:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Hope that helps.

    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘OpenGraph global fallback not working’ is closed to new replies.