Hello,
Thank you for contacting Rank Math today.
Yes adding an English language tag would be a great call. You can achieve this using the following code snippet:
/**
* 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;
});
Looking forward to helping you. Thank you.
Hi Michael,
thank you! Where has this snippet to be put in? Functions.php of the child-theme?
And do you have a URL with explaining details?
What happens if there are more than one languages?
Thanks and best regards
Michael
Hello,
Thank you for contacting Rank Math today.
Yes, you need to add the code snippet in your Functions.php file. I have already edited the code for you in my previous reply. In case of multilingual, I’d recommend using a plugin, WPML for example.
Looking forward to helping you. Thank you.
Hi Michael,
I have added the code, but as I have seen, this code snipped only addresses the social media language tag (opengraph, …), not the whole website-language tag.
Is this OK? Do I have to add a dedicated WEBSITE-language tag?
=> If yes: is there another code snipped … or does this only work with e.g. WPML?
Thanks and best regards
Michael
Hello,
Thank you for contacting Rank Math today.
The main language tag is added by WordPress or a multilingual plugin such as WPML and thus it is not possible to control this on our plugin.
I can suggest that you install WPML or any other multilingual plugin.
Looking forward to helping you. Thank you.
Hello,
We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.
If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.
If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.