Schema markup for the homepage

#547276
  • Resolved Ikytai
    Rank Math free

    Hi, by default, rankmath created schema markup for my homepage
    I wanted to remove all and customize the markup by myself.

    Please suggest how I can remove the default markup on my homepage. Thanks

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention.

    You may add the following filters to remove all default schema from the homepage:

    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
    	if ( is_front_page()  ) {
    		unset($data['WebPage'], $data['WebSite'], 
    		$data['ProfilePage'], $data['publisher'], $data['place'] );
    	}
    
            return $data;
    }, 99, 2);
    
    /**
     * Filter to enable/disable SearchAction JSON-LD data
     */
    
    add_filter( 'rank_math/json_ld/disable_search', '__return_true' );

    Here’s how you can add filters/hooks to your WordPress site:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Let us know how it goes. Looking forward to helping 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 ‘Schema markup for the homepage’ is closed to new replies.