How to remove og:updated_time,og:type and how to add country in meta data?

  • Dear Rankmath Team,

    I really loves Rank math.

    For my upcoming website i need to remove below
    <meta property=”og:updated_time” content=”2019-11-22T06:03:01+00:00″>
    <meta property=”og:type” content=”article”>

    because i’m adding few tools like BMI calculator and some other tools. These are not articles and date is not required. How can i remove these options.

    My competitor using below tag on their website
    <meta name=”country” content=”IN” />

    Is there anyway i can add country in meta data, I’m targeting USA visitors on my website. How to do that?

    Why meta keywords (focus_keyword) are not showing in source code of my website?

    Please provide your valuable suggestions.

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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.

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

You must be logged in to reply to this ticket.