Hello,
We apologize for the issue you are facing with Googlebot crawling and indexing filtered URLs on your WooCommerce shop. Thank you for raising this concern.
To automatically add the rel="nofollow"
attribute to filter links generated by WooCommerce, you can use Rank Math’s settings. However, please note that Rank Math does not have a built-in feature specifically for adding rel="nofollow"
to query parameter links directly. Instead, you can manage this through the following steps:
Step-by-Step Guide to Add Nofollow to Filter Links:
-
Navigate to Rank Math Settings:
- Go to your WordPress dashboard.
- Click on Rank Math in the left sidebar.
- Select General Settings.
-
Enable Nofollow External Links:
- In the General Settings, look for the Links tab.
- Enable the Nofollow External Links option. This will apply the
nofollow
attribute to all external links by default.

-
Add Specific Domains to Nofollow:
- If you want to add specific domains or URLs to be nofollowed, you can use the Nofollow Domains option under the same Links settings. Enter the domains that you want to apply the nofollow attribute to, one per line.

-
Custom Code (if necessary):
- If you need more granular control over specific query parameters or WooCommerce filter links, you may need to implement custom code in your theme’s
functions.php
file or use a custom plugin. This would involve hooking into WooCommerce’s output and adding the rel="nofollow"
attribute to those specific links.
Example of Custom Code:
Here’s a simple example of how you might add rel="nofollow"
to specific links:
add_filter('woocommerce_loop_add_to_cart_link', 'add_nofollow_to_filter_links', 10, 2);
function add_nofollow_to_filter_links($link, $product) {
if (strpos($link, 'highlight_filter') !== false || strpos($link, 'filter_arbeitsspeicher') !== false) {
$link = str_replace('href=', 'rel="nofollow" href=', $link);
}
return $link;
}
This code checks if the link contains specific query parameters and adds the rel="nofollow"
attribute accordingly.
Conclusion:
While Rank Math provides some options for managing nofollow attributes, for specific query parameters like those in WooCommerce filter links, you may need to implement custom code for complete control. If you have further questions or need assistance with the custom code, please reply to this ticket, and a human agent from our support team will assist you further.
Thank you for your understanding, and we hope this helps resolve your issue!
Sources:
How to Nofollow Specific External Links in WordPress With Rank Math SEO » Rank Math
This is an automated reply from Rank Math Support Bot. If you need further assistance, please reply to this topic and a human support agent will reply to you shortly.