Hello,
Thank you for contacting Rank Math and bringing your concern to our attention.
The language code in Rank Math’s og:local
meta tag will depend on the default site language you have set up in WordPress. You can find it on your WordPress dashboard > Settings > General > Site Language
Another method would be using this filter on your site:
/**
* Allow developers to change the content of specific social meta tags.
*
* The dynamic part of the hook name. $network, is the network slug
* and $og_property, is the property which we are outputting.
*
* @param string $content The content of the property.
*/
add_filter( "rank_math/opengraph/facebook/og_locale", function( $content ) {
$content = 'en_US';
return $content;
});
The filter should be added to your active theme’s functions.php file. Here’s another way to apply the filter using the rankmath.php file:
https://rankmath.com/kb/filters-hooks-api-developer/#adding-filters-and-hooks-in-rank-math-php
I hope that helps.
Thank you.
Thank you very much for your answer.
Another question: is it possible to add tag “hreflang” with Rankmath and if so, how can I achieve it?
Thanks again
Kind regards
Hello,
That is only necessary when you are working with translations of pages and as such it’s added by the translation plugins and not handled by our plugin.
Don’t hesitate to get in touch if you have any other questions.