Need Help Regarding Local Schema

#513134
  • Resolved V Digitalx
    Rank Math free

    Hi,
    I’ve used Rankmath’s local business schema, and it’s validated.
    As I’ve also used the Rankmath schemas for articles and FAQs. The Code validator detects local business schemas on all articles.
    I need to know how to remove it.
    image of rich snippet results detecting the schemas

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.

    It seems that you’re currently using the Rank Math PRO plugin, but the account you have used to open this ticket is the Rank Math free version.

    Can you please search and forward a receipt from FastSpring.com so we can locate your account and verify it?

    Back to your issue, please use the following filter to disable the Local SEO schema only on specific pages:

    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
        global $post;
        $remove_ids = array(1,2,3); // Replace 1,2,3 with your post ID(s)
    
        if(!empty($post->ID) && is_numeric($post->ID) && in_array((int)$post->ID, $remove_ids)){
            unset( $data['publisher'] );
    	unset( $data['place'] );
        }
        
      return $data;
    }, 99, 2);
    

    However, if you just want to use Local Business Schema only on your Homepage then please try the following filter. It will remove Local Business Schema from all pages except Homepage:

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

    Here is how to add a filter to your 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 ‘Need Help Regarding Local Schema’ is closed to new replies.