Remove date from search results

#8626
  • Resolved Garry
    Rank Math free

    Hello there, I don’t want Google to show date in search results. But Rank Math add published time as meta value in page source like this…

    <meta property="og:updated_time" content="2019-06-10T15:17:24+00:00">

    or

    <meta property="article:published_time" content="2018-11-11T15:23:41+00:00">

    Even if the page doesn’t show published or updated date publically(disable from the theme options) it still shows up in the page source as meta value.

    How can I remove this 😢

    • This topic was modified 5 years, 6 months ago by Garry.
Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    It is not recommended to remove these tags from your post since you may end up getting penalized by Google. If you would like to go ahead and remove these tags, you can add the following code to your theme’s functions.php file:

    /**
     * Rank Math code 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/article_published_time", function( $content ) {
    	$content = '';
    	return $content;
    });
    add_filter( "rank_math/opengraph/facebook/article_modified_time", function( $content ) {
    	$content = '';
    	return $content;
    });
    add_filter( "rank_math/opengraph/facebook/og_updated_time", function( $content ) {
    	$content = '';
    	return $content;
    });
    

    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.

Viewing 1 replies (of 1 total)

The ticket ‘Remove date from search results’ is closed to new replies.