Hello,
I apologize for the issue you are facing with modifying the CollectionPage Schema using Rank Math. It seems like you’re trying to append a custom value but are not seeing the expected results. Unfortunately, the context does not provide specific details on using filters for modifying default schemas in Rank Math.
To address your second question about applying a custom schema to an archive, you can create a Schema Template in Rank Math PRO. Here’s how you can do that:
- Navigate to the Schema Templates: Go to the Rank Math dashboard and find the Schema Templates section.
- Create a New Template: Click on "Add New" to create a new schema template.
- Select the Type: Choose the type of schema you want to create (in your case, it would be CollectionPage).
- Set Display Conditions: In the Display Conditions tab, you can specify where this schema should be applied. You can select options like All Archives or specific taxonomies.
- Save Your Changes: Once you have configured your schema and conditions, make sure to save your changes.
If you need more detailed guidance on setting up Schema Templates, you can refer to our tutorial on Schema Templates.
If you continue to experience issues or need further assistance, please reply to this ticket, and a human agent from our support team will take over and provide more personalized help. Additionally, if you could include your site URL in your reply, it would help us assist you better.
Thank you for raising this concern!
Sources:
How to Use Schema Templates in Rank Math PRO » Rank Math
Hello,
Thank you so much for getting in touch.
Since the CollectionPage
schema is not editable via our plugin settings, You can use this filter code to apply changes to the structure:
add_filter('rank_math/json_ld', function ($data, $jsonld) {
if (is_category() || is_tag() || is_tax()) {
foreach ($data as $key => $schema) {
if ($schema['@type'] === 'CollectionPage') {
$data[$key]['@type'] = 'YOUR CHANGES HERE...';
break;
}
}
}
return $data;
}, 99, 2);
You may refer to this guide on how to add filters to your website: https://rankmath.com/kb/wordpress-hooks-actions-filters/
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
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.