Incorrect property “og:image” value

#924686
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.

    We checked the product page you’ve shared and we can see it is returning a 404 error and that’s why the default OpenGraph Thumbnail image is added on that page which you’ve set in Rank Math > Titles & Meta > Global Meta setting.

    If you’re facing the issue with some other product pages, please share the URL with us so that we can check this further for you.

    Looking forward to helping you.

    Hello,

    Your product image is too small and it also returned as empty in the media library as you can see here:

    Rank Math support

    Please make sure to upload a much bigger-sized image. A size of 1200×630 should be ideal.

    However, we can force Rank Math to load any image by using the filter code below:

    add_filter( "rank_math/opengraph/facebook/og_image", function($url){
    	if(is_product()){
    		$product = wc_get_product( get_the_ID() );
    		if ( has_post_thumbnail( $product->get_id() ) ) {
    			$url = get_the_post_thumbnail_url( $product->get_id(), 'full' ); 
    		}
    	}
    	return $url;
    });

    You may refer to this guide on how to add filters to your website: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Don’t hesitate to get in touch with us if you have any other questions.

    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 2 replies - 1 through 2 (of 2 total)

The ticket ‘Incorrect property “og:image” value’ is closed to new replies.