Hello,
Thank you for contacting Rank Math today.
You can add the following code on your theme’s functions.php file and then modify it further as described on the comments:
/**
* Change Rank Math OG 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 ) {
//replace /custompagename/ with the path to the page you want to
//modify the tags
if($_SERVER['REQUEST_URI']=="/custompagename/"){
//replace en_UK with your preferred locale
$content = "en_UK";
return $content;
}
return $content;
});
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.