Remove datePublished and review from schema

#6854
Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi John,

    Thanks for getting in touch with us.

    The preview of your review is added in accordance with the Google guidelines which suggest that a webmaster should show the schema to the users as well as to the bots.

    If you show it to just the bots, you run the risk of getting removed from the rich snippets program. That is the reason it is being added to the frontend.

    Although we do not recommend removing it from the frontend – Rank Math allows you to take full control of your SEO. You can add the following code to your theme’s functions.php file:

    /**
     * Filter: Allow disabling the review display.
     *
     * @param bool $return true to disable.
     */
    add_filter( 'rank_math/snippet/review/hide_data', '__return_true' );

    To remove the datePublished data, please make use of the same code shared by my colleague above:

    add_filter( 'rank_math/snippet/rich_snippet_article_entity', function( $data ) {
    	unset( $data['datePublished'] );
    	return $data;
    }, 10, 1 );

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    HI Michael Davis,

    Thank you for your reply!

    Review section still showing in the testing tool.

    Thank you.

    Todd
    Rank Math free

    Hi John,

    Please share a link to your page so we can check.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Thank you, everyone!

    Hi John,

    Thanks for the follow up.

    The sensitive data is empty, have you been able to resolve this?

    I am looking forward to helping you. Thank you.

    Gopi
    Rank Math free

    Thanks its working fine.

    Hi Gopi,

    Thanks for the follow up.

    I am glad that the issue is now resolved 🙂

    Feel free to contact us should you run into any other difficulty.

    Thank you.

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

The ticket ‘Remove datePublished and review from schema’ is closed to new replies.