How to remove ‘author’/’Person’ schema from Woo Products

#383281
  • Resolved Dmitriy Shevchenko
    Rank Math free

    For some reason, I see that the product single page markup includes the “Person” schema. How do I get rid of it? I looked around and didn’t find a way to remove it in RankMath settings.

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

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    To remove the default Person Schema from your pages, you can add the following filter to your website:

    add_filter( 'rank_math/json_ld', function( $entities, $jsonld ) {
    
        if ( isset( $entities['ProfilePage'] ) ) {
            $id = $entities['ProfilePage']['@id'];
            foreach ( $entities as $key => $entity ) {
                if ( isset( $entity['author' ]['@id'] ) && $id === $entity['author' ]['@id'] ) {
                    unset( $entities[ $key ]['author'] );
                }
            }
            unset( $entities['ProfilePage'] );
        }
    
        return $entities;
    }, 999, 2 );

    And here’s a link on how to apply a filter on your site:
    https://rankmath.com/kb/filters-hooks-api-developer/#how-to-add-code-snippets-to-rank-math-php

    I hope that helps.

    Thank you.

    Looks like this solved the issue. Thanks!

    Anas
    Rank Math business

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

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

The ticket ‘How to remove ‘author’/’Person’ schema from Woo Products’ is closed to new replies.