Schema

#455847
  • Resolved Ariel S
    Rank Math pro

    Although I created a specific schema for this location page https://stibermanlaw.com/bankruptcy-attorney-fort-lauderdale/ with specific information pertaining to this page (Fort lauderdale postal address, etc), when I inspect the code I also see schema information related the home page ( Holywood, FL postal address, etc).

    In the “Schema In Use” section I am only showing the Service schema I specifically created or this page which does not contain any non Fort Lauderdale related info.

    How can I make only the Fort Lauderdale Schema info appear?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Nigel
    Rank Math business

    Hello,

    Thank you for contacting Rank Math for help with your location schema.

    Please note that the main organization schema gets added to all pages on your website including specific location pages. To disable

    To disable the default location schema for the page, please try the following code snippet:

    
    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
        if ( !is_page('bankruptcy-attorney-fort-lauderdale'){
            return $data;
        }
        unset ($data['Place']);
        unset ($data['organization']);
        return $data;
    }
    

    You can follow this guide for how to add filters to your website: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Hope that helps. Please let us know if you have questions.

    Hi, my developer has advised me that the code contains syntax errors  and proposed the following fix (but it is throwing a wordpress error)

    add_filter( ‘rank_math/json_ld’, function( $data, $jsonld ) {
    if ( !is_page(‘bankruptcy-attorney-fort-lauderdale’)){
    return $data;
    }
    unset ($data[‘Place’]);
    unset ($data[‘organization’]);
    return $data;
    });

    Please review and provide me with the correct codes.

    Hello,

    We apologize for that, please refer to this code instead:

    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
      if ( !is_page('bankruptcy-attorney-fort-lauderdale')){
        return $data;
      }
      unset ($data['Place']);
      unset ($data['organization']);
      return $data;
    }, 99, 2);

    Let us know how that goes. 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 3 replies - 1 through 3 (of 3 total)

The ticket ‘Schema’ is closed to new replies.