I want to remove the date from search result schema for (Product,Post)

#867122
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    We apologize for the issue you are facing with removing the date from the search result schema for your products and posts. Thank you for raising this concern.

    To remove the date from the schema for both posts and products, you can use the following filters in your theme’s functions.php file:

    For Posts:

    To remove the date properties from the structured data for posts, you can add this code:

    add_filter( "rank_math/snippet/rich_snippet_article_entity", function( $entity ) {
      unset( $entity['dateModified'] );
      unset( $entity['datePublished'] );
      return $entity;
    });

    For Products:

    To remove the date properties from the structured data for products, you can use this code:

    add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
      unset( $entity['dateModified'] );
      unset( $entity['datePublished'] );
      return $entity;
    });

    Important Note:

    Please ensure that you have a backup of your functions.php file before making any changes. After adding these filters, clear your site cache and check if the dates are removed from the schema.

    If you continue to experience issues, please reply to this ticket, and a human agent from the Rank Math Support team will assist you further.

    Thank you for your understanding!

    Sources:
    How to Remove Date Snippets from Search Results » Rank Math

    I tried it, I already added these two code to my function file but see still they are showing to my source code – https://imgur.com/a/1bZpyfp
    I cleared the cache already still showing.

    Hello,

    Thank you for your query and we are so sorry about the trouble this must have caused.

    Upon checking the URL on the SERP, we see that January 5 has been added. We see there are two instances of meta and schema structure that are showing that specific date so Google may have been referencing the date from those instances.

    Rank Math support

    To remove the ya:ovs:upload_date meta tag, you may use this code below in your website:

    
    add_filter( 'rank_math/opengraph/facebook/ya_ovs_upload_date', '__return_false');

    You may refer to this guide on how to add filters to your website: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Lastly, the second instance of date was found in your video schema (uploadDate property), however, it may not be recommended to modify that property.

    Let us know if removing the ya:ovs:upload_date meta tag works without changing the uploadDate property.

    Looking forward to hearing back from 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 3 replies - 1 through 3 (of 3 total)

The ticket ‘I want to remove the date from search result schema for (Product,Post)’ is closed to new replies.