Locale inconsistency

#1092676
  • Resolved Adrian Hoche
    Rank Math free

    Hi,
    I recently found out, that our website is sending out mixed signals in terms of our locale.

    The website is hosted for a local Austrian scout group.

    I already checked, the language/locale in WordPress settings is set to German (Austria), de_AT. Also this reflects in the lang argument of the <html> tag.

    Unfortunately and against how it’s described in your documentation, RankMath plugin does not take this value and uses instead de_DE in og:locale, schema-markup and maybe some other places I didn’t check.
    source code sample
    Can you please tell me how this can be fixed? Thanks!

    BR Adrian

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

    We apologize for the issue you are facing with the locale settings on your website. It seems that Rank Math is not reflecting the correct locale of de_AT (German – Austria) and is instead using de_DE (German – Germany).

    The og:locale tag in Rank Math is automatically generated based on the language selected in your WordPress General Settings. If your desired language is not being reflected correctly, it may be due to a limitation in how Rank Math fetches the locale from WordPress.

    To address this, you can manually set the og:locale tag using a filter in your theme’s functions.php file. Here’s how you can do it:

    add_filter( "rank_math/opengraph/facebook/og_locale", function( $content ) {
        return 'de_AT'; // Set your desired locale here
    });

    This code snippet will ensure that the og:locale tag uses de_AT instead of the default value.

    If you need further assistance or if this does not resolve the issue, we recommend replying to this ticket, and a human agent from the Rank Math Support team will take over and provide more detailed help.

    Thank you for bringing this to our attention, and we hope this helps!

    Sources:
    Open Graph Meta Tags » Rank Math

    Adrian Hoche
    Rank Math free

    Thanks for the quick response.

    Fixed it with this workaround.

    Kind of a strange bug in your plugin… coding wise this should be just reading a value… funny. Will this be fixed in a future version? Might this issue exist with other countries too?

    BR Adrian

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this ticket.