Schema Markup Code and Help

  • Hi. We are trying to add additional schema markup to our website beyond what is offered in RankMath or others. I posted to the RankMath FB page and you suggested I open a support ticket. Here is the original Facebook post, as well as our desired changes below that….

    Andrea Finkelstein
    Conversation Starter · 18 hrs · tag Question
    Hi everyone! Since my last post/question, we went a little different schema route than I thought. We were going to use a different plug in for schema and rich snippets and turn off Rank Math for those portions. But, they also left a lot to be desired. So, now we have a programmer adding json schema coding to improve productontology, product catalog, service area, and more. We would like to still use Rank Math for the basics and then add lines within it (ie you might have our service area in Phoenix, but we want to define it as metro Phoenix by directing Google to what we mean by Phoenix. But, I can’t seem to find where you are placing your schema for these items. It isn’t in the header.php file, as I had expected. Can you please enlighten us? Has anyone else following these posts done something similar? Thank you!
    11
    8 Comments
    Like
    Comment
    Comments
    Rank Math
    Rank Math Hello Andrea Finkelstein
    Are you planning to extend the Schema Markup functionality of Rank Math? If so, then you need to use the filters which go into theme’s functions.php file

    Rank Math SEO Filters and Hooks for Developers


    If you can tell us more about the fields are you are looking to add to a particular Schema type, we can provide you with the code.
    Or are you looking to add those fields only to the homepage?
    Looking forward to helping you. Thank you.
    Hide or report this
    Rank Math SEO Filters and Hooks for Developers – Rank Math
    RANKMATH.COM
    Rank Math SEO Filters and Hooks for Developers – Rank Math
    Rank Math SEO Filters and Hooks for Developers – Rank Math
    1
    Love
    · Reply · 18h
    Andrea Finkelstein

    Here is our ‘wish list’ so to speak….
    Specifically, Schema.org only offers either professional service or service, and doesn’t drill down for our industry (cleaning). In addition, there are many types of cleaning companies and services, some we do, some we don’t offer, such as carpet cleaning. We are going to add the definitions for residential cleaning and commercial cleaning into our schema to help Google better understand exactly what we do, and help target to those two areas beyond what our content and rich snippets already provide, or at least this will strengthen them even further. I don’t have a sample of the schema syntax for this, but I can find it if you need.

    In addition, we will be making a product catalog in schema, to again further target these areas.
    Here is a sample of the catalog from a website. It is not ours specifically.
    “@type”: “OfferCatalog”,
    “name”: “House Cleaning”,
    “itemListElement”: [
    {
    “@type”: “Offer”,
    “itemOffered”: {
    “@type”: “Service”,
    “name”: “Apartment light cleaning”
    }
    },
    {
    “@type”: “Offer”,
    “itemOffered”: {
    “@type”: “Service”,
    “name”: “House light cleaning up to 2 bedrooms”
    }
    },

    Another area we will be adding schema info to is “areas served.” Google thinks that, because we are in the ‘suburb’ of Scottsdale, we primarily service Scottsdale. We already have quite a bit of SEO on page. But, we are going to do two things in schema here, too. We want area served to be Phoenix, with a supporting schema reference to the definition of Metropolitan Phoenix. Then, we’d also like to add ‘other areas served’ to add all of the other ‘suburbs’ of metro Phoenix.

    Next, our plan is to also add our Thumbtack presence and HomeAdvisor presence to ‘same as’ schema, as you are offering Facebook, Twitter, and similar, but not these. We have a strong presence on these and other ranking sites.

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math today.

    This sounds very interesting, I am not quite sure I have understood the kind of help you need from our end. All these requirements can be achieved by adding custom schema markup within this filter:

    /**
     * Collect data to output in JSON-LD.
     *
     * @param array  $unsigned An array of data to output in json-ld.
     * @param JsonLD $unsigned JsonLD instance.
     */
    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
    	return [];
    }, 10, 2);

    Your custom schema markup will then be integrated in the json-ld data that is already available on the page from Rank Math.
    The schema data can be found on the < head > section as shown below:
    IMG

    Looking forward to helping you. Thank you.

    ​​​​​​​

Viewing 1 replies (of 1 total)

You must be logged in to reply to this ticket.