Hello,
Thank you for contacting Rank Math today.
You can add your schema through Rank math on your page source by extending our existing JSON-LD. You can use the following filter and add it to your theme functions.php:
/**
* 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);
Looking forward to helping you. Thank you.
Hi Michael,
1. If we use CodeSnipets plugin how do we integrate your code?
2. Once we integrate, do we just have to copy page the JSON-LD code into the prescribed article by adding ‘Custom HTML’ block?
Thanks,
S
Hi Michael, can I copy+paste the code you have given me into a CodeSnipets ‘New Snippet’ or should it only feature on the functions.php file?
Hello,
About the plugin you mention, I don’t know how it adds the code; you might need to test it and if it doesn’t work, use the functions.php option.
About the second question, you will need to modify the code according to your needs (or hire a freelancer to do that).
Looking forward to help 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.