Remove Post’s Schema from Rank Math

#845216
  • Resolved filippo5e41243193
    Rank Math free

    Hi.
    I used your WP Schema Pro import on Rank Math but I don’t like that I got schemas in my posts that look like they were inserted manually and I would prefer to delete them all to use a dynamic solution.
    Since I have more than 50,000 posts, the ideal would be a code like the one suggested in your guide:

    
    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
        if ( ! is_front_page() || ! isset( $data['publisher'] ) ) {
            return $data;
        }	
        unset($data['publisher']); //set the data to remove
        return $data;	
    }, 99, 2);
    

    I would like, if possible, that it was adapted to delete any schema from any post.
    Can you help me?

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

    We apologize for the issue you are facing with the schemas in your posts. Thank you for raising this concern.

    To remove all Schema from your posts, you can use the following code snippet. This will effectively clear any Schema data from all posts:

    add_filter('rank_math/json_ld', function ($data, $jsonld) {
        return [];
    }, 99, 2);

    This code will return an empty array for the JSON-LD data, effectively removing all Schema from your posts.

    You can add this code to your theme’s functions.php file or a custom plugin. If you need further assistance or have any questions, feel free to reply to this ticket, and a human agent from the Rank Math Support team will be happy to help you.

    Best regards!

    Sources:
    Remove All Schema from Product Category Pages » Rank Math

    Hello,

    The filter you have shared is for removing the Organization schema on all of your posts and pages except the homepage:
    https://rankmath.com/kb/remove-organization-schema/

    Could you please share the post URL so we can check the schema? Also, which properties are you going to modify?

    Looking forward to helping 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 2 replies - 1 through 2 (of 2 total)

The ticket ‘Remove Post’s Schema from Rank Math’ is closed to new replies.