Support » Plugin: Rank Math SEO with AI SEO Tools » Posts images overridden by Local SEO logo

  • Resolved scooterlord

    (@scooterlord)


    Hello,

    thank you again for the wonderful plugin!

    When sharing my posts I would expect that the post images are used in the social sharing cards, however, they are overriden by the local SEO image. Is this considered the standard functionality or am I doing something wrong?

    Looking forward to your reply!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter scooterlord

    (@scooterlord)

    Hello again,

    I wanted to elaborate a bit more on this one, since I realized what’s wrong.

    My posts do not have a featured image set, nor the content itself has any photo content, so by reading the docs more carefully, it correctly show the default local seo image.

    However, each of my posts might have several attachments bound to the post – so what I am trying to do is to replace the default og:image on demand only when a post has attachments on it. Reading your docs, I would expect the following filter to work, but it doesn’t. Is there any other option I am missing?

    add_filter( "rank_math/opengraph/{$network}/image", function( $attachment_url ) {
      return $attachment_url;
    });

    I tried both facebook and twitter without luck. Any help?

    Plugin Author Rank Math

    (@rankmath)

    Hello @scooterlord,

    Thank you for contacting the support and sorry for not following up quickly and any inconvenience that might have been caused due to that.

    By default we use the image from Titles & Meta >> Global Meta.

    Please check this screencast:
    https://i.rankmath.com/SEJgQx

    The opengraph/$network/image filter is working fine. You will have to change the $network variable to facebook or twitter:

    add_filter( "rank_math/opengraph/facebook/image", function( $attachment_url ) {
    	return 'https://google.com/image.png';
    });

    Hope that helps.

    Thread Starter scooterlord

    (@scooterlord)

    Thank you for your reply. Actually it was a caching issue, worked my way through it! Thanks a million!

    Plugin Author Rank Math

    (@rankmath)

    Hello @scooterlord

    Glad that’s sorted.

    If it isn’t too much to ask for – would you mind leaving us a review here?
    https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post

    It only takes a couple of minutes but helps us tremendously.

    It would mean so much to us and would go a really long way.

    Thank you.​​

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Posts images overridden by Local SEO logo’ is closed to new replies.