Hello,
Thank you for contacting us.
Could you share a few example pages/links so that we can have a closer look?
Looking forward to helping you.
Thank you.
Hi,
I don’t have any specific example, as I am still building my website architecture. The URL I am talking about are those with filter parameters like:
https://www.clubcalzature.com/shoes/sandals/?size=43
Let’s suppose that I want to make indexable this specific URL (with this attribute and this value for the attribute) and that I want to customize its H1, title, and metadescription, so that they are different from the URL without the parameter. Can I do it?
Hello,
We do not control the H1 tags on the page and hence dynamically modifying that with Rank Math would not be possible. You can get in touch with your theme developers regarding this.
However, for setting the page indexable, SEO title, and meta description, the below filters can be modified and used:
Set indexable: https://rankmath.com/kb/filters-hooks-api-developer/#change-robots-meta
SEO Title: https://rankmath.com/kb/filters-hooks-api-developer/#change-the-title
Meta Description: https://rankmath.com/kb/filters-hooks-api-developer/#change-meta-description
Here’s a sample code that you can further modify as per the requirement:
/**
* Filter to change the page title.
*
* @param string $title
*/
add_filter( 'rank_math/frontend/title', function( $title ) {
if( strpos( $_SERVER['REQUEST_URI'], '/shoes/sandals/?size=43' ) ){
$title = 'Custom Title'; //Modify the title text here
}
return $title;
});
This code modifies the SEO title of the URI /shoes/sandals/?size=43
.
You can follow this guide to add the code:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
Hope this 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.