Remove Date

#101143
  • Resolved Vrporndave
    Rank Math free

    Can I remove “datePublished”: “2017-02-24T03:03:38-05:00”,
    “dateModified”: “2020-11-10T05:14:46-05:00”,

    Those data points from schema?

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math.

    These properties are recommended by Google for your schema markup.If you still wish to remove this you can use the following filter:

    /**
     * Filter to change the schema data.
     * Replace $schema_type with schema name like article, review, etc.
     * @param array $entity Snippet Data
     * @return array
     */
    add_filter( "rank_math/snippet/rich_snippet_{$schema}_entity", function( $entity ) { 
             unset( $entity['datePublished']);
             unset( $entity['dateModified']);
             return $entity;
    });

    The code is to be customized and added to your theme functions.php file.

    Hope this helps 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.

Viewing 1 replies (of 1 total)

The ticket ‘Remove Date’ is closed to new replies.