How to change hreflang tag in property og:locale en_US to sv_SE?

#539328
  • Resolved Branislav Bjelic
    Rank Math free

    Hello, how are you? I need help. I spent a lot of time to fix my problem but without success.
    I use your plugin and I have website on Swedish language. Problem is that I changed main hreflang tag to sv-SE and now I have problem that I can’t change hreflang tag ‘property og:locale en_US’. I tried using your plugin but plugin doesn’t have any section for hreflang tag.

    I also tried to change it using HTML code but without success. Can you please help me and tell how to change that hreflang tag from en_US to sv_SE?

    I added in header code ‘og:locale sv_SE’ but still I have the first one ‘og:locale en_US’ and that made me a problem in SEO tools where I can see I have two language on my website. I don’t have.

    Here is link of picture: https://imgur.com/a/GOkqIvK

Viewing 1 replies (of 1 total)
  • Hello,

    Thanks for contacting us, and sorry for any inconvenience that might have been caused due to that.

    Please follow the guide below to change the og:local value on your site:
    https://rankmath.com/kb/open-graph-meta-tags/#og-locale

    If the issue persists, please try applying the following filter on your site to change the value of og:locale property.

    add_filter( "rank_math/opengraph/facebook/og_locale", function( $content ) {
            $content = 'sv_SE';
    	return $content;
    });

    Here’s how you can add filters/hooks to your WordPress site:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Let us know how it goes. Looking forward to helping you.

    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 ‘How to change hreflang tag in property og:locale en_US to sv_SE?’ is closed to new replies.