Hello @comicschau,
Thank you for contacting us, and sorry for any inconvenience that might have been caused due to that.
You can handle those in two ways. Either way, you can disallow those URLs with a query parameter in your robots.txt file to prevent search engine bots from crawling them. Here’s an example of how they should look like:User-agent: * Disallow: */?quad_cc Disallow: */?amp
Here’s how you can edit the robots.txt file using Rank Math:
https://rankmath.com/kb/add-sitemaps-to-robots-txt/#num-2-2-navigate-to-edit-robots-txt
Or, you may use the following filter to set noindex to those URLs with specific query parameters:add_filter( 'rank_math/frontend/robots', function( $robots ) { $url = home_url( $_SERVER['REQUEST_URI'] ); if( (strpos($url,"?quad_cc") !== false) || (strpos($url,"?amp") !== false) ) { $robots["index"] = 'noindex'; $robots["follow"] = 'nofollow'; } return $robots; });
The filter shared above, will set noindex robots meta directive to all the URLs that contain ?quad_cc and ?amp.
Here’s how you can add a filter/hook to your WordPress site:
If those URLs are already indexed on SERPs, we’d recommend following the second method to get rid of them from SERPs.
Hope that helps, and please do not hesitate to let us know if you need our assistance with anything else.
