-
How can I bypass the RankMath LocalBusiness JSON Script and use my own? Thanks
-
Hello,
I apologize for the issue you are facing. Unfortunately, the context does not provide specific instructions on bypassing the Rank Math LocalBusiness JSON script to use your own.
If you have further details or specific requirements regarding your request, please reply to this ticket, and a human agent from the Rank Math Support team will be able to assist you more effectively. Thank you for your understanding!
This is an automated reply from Rank Math Support Bot. Your ticket has been assigned to a human agent and we will get back to you shortly.
Looking for some clarification here, thanks in advance 😀
I would really like to use my own local business JSON script in the header.
Is RankMath going to overwrite it?
If so, can I disable RankMath’s script? How?
Thanks!
Hello,
Thank you for your patience.
You can use this filter to disable Rank Math’s automatic Organization and Local Business schema on your site:
add_filter( 'rank_math/json_ld', function( $data, $jsonld ) { unset( $data['publisher'] ); unset( $data['place'] ); return $data; }, 99, 2);
Here’s how you can add a filter/hook to your WordPress site:
https://rankmath.com/kb/wordpress-hooks-actions-filters/Let us know how this goes.
Thank you for this very much. Regarding that plug-in, if I put your script in as priority 10 and mine as priority 20, does that mean the first it would not read yours and then read mine? Do I have this right? Here is a screenshot;
Thanks again!
Eric
It looks like the short script you provided to prevent RankMath’s schema didn’t work. Can you check or fix it ple ase?
Also, my previous question about https://wordpress.org/plugins/code-snippets/ – what should be the priorities for your script and mine? Yours is currently 10, mine 20.
Again, thanks so much!
This is what is in the page code at https://corezerostudio.com
application/ld+json class=”rank-math-schema
I was blocked with your security thing because it looked like a sequel injection or whatever so anyway you can check the code on the website, but it starts with the word script and then the rest of that line followed by the RankMath schema.
Hello,
Thank you for your patience.
You can use this tool to paste your own local business code and add here the generated link so we can check as well:
https://pastebin.com/Meanwhile, please try this filter instead and check if the schema is removed:
add_filter( 'rank_math/json_ld', function( $data, $jsonld ) { if ( ! isset( $data['publisher'] ) ) { return $data; } unset( $data['publisher'] ); unset( $data['place'] ); return $data; }, 99, 2);
Regarding the priority, you can set our filter to priority
10
in the plugin. The lower number means it will be executed first.Looking forward to helping you.
OK I’m going to try another route. If I add my own local business ski script directly into heather.php is it going to mess up your plug-in or is your plug-in going to overwrite what I have there? Thanks again!
Hello,
If you add your own LocalBusiness JSON-LD script directly in header.php, Rank Math will not overwrite it.
Don’t hesitate to let us know if you need our assistance with anything else.
OK good to know. I think just one more thing. Will rank math inject its own values and tell Google something different than my script? Thanks again for all the help on this.
Hello,
Rank Math may still inject its own schema unless disabled using the filter code we shared. If both exist, Google may choose which one to use. To prevent conflicts, we recommend disabling Rank Math’s LocalBusiness schema using the provided filter.
Hope that helps.
You must be logged in to reply to this ticket.