Remove Date

  • 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.

    ​​​​​​

Viewing 1 replies (of 1 total)

You must be logged in to reply to this ticket.