Hello,
Thank you for contacting Rank Math today and for your kind words.
1). You can add the following code to your theme’s functions.php file to remove these og tags:
/*
* Rank Math snippet to disable og:updated_time & og:type
*
*/
add_filter( "rank_math/opengraph/facebook/og_updated_time","__return_false");
add_filter( "rank_math/opengraph/facebook/og_type","__return_false");
2). We do not have this meta tag in the plugin but you can hardcode this meta tag to the header section by using a hook that is called on the header of your theme.
Rank Math only adds the following tag:
<meta property="og:locale" content="en_US">
3). Google does not honor Meta Keywords for quite a long now so we never added them to the plugin.
You can read more about that here:
https://webmasters.googleblog.com/2009/09/google-does-not-use-keywords-meta-tag.html
You can however enable this feature by adding the following code to your theme’s functions.php file:
/**
* Add <meta name="keywords" content="focus keywords">.
*/
add_filter( 'rank_math/frontend/show_keywords', '__return_true');
Hope that helps. If you have any further question(s), please let us know. Thank you.
@Michael Davis Thank you so much for detailed reply.
Few more questions. Kindly provide your suggestions please.
1. I want these filters only for particular posts not for the entire site. How can i handle this
add_filter( "rank_math/opengraph/facebook/og_updated_time","__return_false");
add_filter( "rank_math/opengraph/facebook/og_type","__return_false");
2. What is the use of this tag
<meta property="og:locale" content="en_US">
3. While adding post on wordpress admin there is option i.e focus keywords? What is the use of them?
Hello,
Thanks for getting back to us and sorry for the delay.
1). You can modify the previous code and add some conditionals to check the current post id and only remove the tags if the condition is met. Here is an example:
/**
* 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_updated_time", function( $content ) {
//Replace '123' with the page id that you want to remove this tag for
if(is_page('123')){
return false;
}
return $content;
});
add_filter( "rank_math/opengraph/facebook/og_type", function( $content ) {
//Replace '123' with the page id that you want to remove this tag for
if(is_page('123')){
return false;
}
return $content;
});
2). This tag us used to define the site language that has been set on the Settings > General page.
3). The focus keyword that you enter on the Rank Math metabox is used as the pivot for the on page content analyis tests to check whether the content has been tailored for this keyword. Tests such as keyword density will use this keyword to generate a score for this post. This also helps to reference the keywords that you want the post to rank for on the SERP.
I hope this info helps. 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.