How to change the Rank Math’s markup default to my markup?

#595932
  • Resolved Anonymous
    Rank Math free

    Hi Rank Math. I have a question about Schema Markup created by Rank Math Plugin.

    I’m using Rank Math Pro, Schema (Structured Data) enabled but don’t want to use Rank Math’s schema markup defaults (WebSite, WebPage or Organization,…).

    Instead I use Custom Schema (in Schema Templates) to manually generate schema markup for each page of my website.

    I’ve noticed that when I manually create schema markup codes with fields that match the data in Rank Math’s default markup set, my code seems to be overwritten.

    But that’s not always in every case.

    For example, I’m creating Website schema markup with identical properties and types to Rank Math’s default code.

    I have tried changing a few things like this:

    Default the Website markup by Rank Math:

    "@publisher": {
    "@type": "WebSite",
    "@id": "https://mywebsite.com/#organization"
    }

    My markup want to change it:

    "@publisher": {
    "@type": "WebSite",
    "@id": "https://mywebsite.com/#website"
    }

    See more in this image: https://prnt.sc/kct1IcGWEeTs

    I checked my code on validator.schema.org but it doesn’t work. My site still recognizes Rank Math’s default markup code (on the right).

    So, how do I change the Rank Math’s markup to my markup?

    Sorry about my english because it’s not my native language. Hope you understand.

    Thanks!

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

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    You mentioned that you’re using Rank Math PRO, but the account you used to open this ticket is the Rank Math free version.

    Can you please search and forward a receipt from FastSpring.com or the email address you used to purchase so we can locate your account and verify it?

    Looking forward to helping you.

    Thank you.

    Anonymous
    Rank Math free

    Hello Reinelle. Thanks for responding to my ticket so quickly.

    It seems my question is a bit misleading. I’m sorry about this.

    Actually, I have no problem with the Rank Math plugin at all.

    What I’m wondering is when I enable Schema in Rank Math (https://prnt.sc/Vj_cNLxp3Z68), Rank Math will automatically generate the appropriate markup for each type of page on the website.

    For example, Organization/WebSite markup is applied to the entire website, Products markup is for product pages (I also use Woocommerce) or Article for blog post pages.

    I’m looking to replace some of the data in the markup code generated by Rank Math with my own.

    For example, here is a snippet in WebSite markup (generated default by Rank Math)

    "@publisher": {
        "@type": "Thing",
        "@id": "https://mywebsite.com/#organization"
    
    }

    And Below is my code that I want to change or override the above code (still in the Website Markup)

    "@publisher": {
        "@type": "Thing",
        "@id": "https://mywebsite.com/#computerstore"
    }

    So, how can I do that?

    Hello,

    Thank you for clarifying.

    To change the default/automatic schema, you may need to use this filter on your site:

    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
    if( isset( $data['publisher'] )) {
    		$data['publisher']['thing']['@id'] = 'https://mywebsite.com/#computerstore';
    		return $data;
    } 
    	return $data;
    }, 99, 2);

    Please edit the URL in the code with your actual domain name.

    And here is a guide you can follow to add the filter:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Hope that helps.

    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 3 replies - 1 through 3 (of 3 total)

The ticket ‘How to change the Rank Math’s markup default to my markup?’ is closed to new replies.