Hello,
I apologize for the issue you are facing with strange URLs appearing on your website and being crawled by Google. To address this problem and set these non-existent search URLs to a 410 status, you can utilize the Rank Math SEO plugin.
By following the steps outlined in our knowledge base article on how to set a 410 status code in bulk for WordPress using Rank Math, you can efficiently handle this situation without the need to purchase an upgraded plugin. You can access the detailed guide here.
The Rank Math SEO plugin allows you to set up 410 status codes for multiple URLs, including those containing "?" and "/search/". By configuring the redirections within the plugin, you can easily manage these URLs and ensure they return a 410 status code.
If you encounter any difficulties or have further questions while implementing these steps, feel free to reply to this ticket, and a human agent from the Rank Math Support team will assist you promptly.
Thank you for reaching out with your concern. We are here to help you with any Rank Math-related queries.
Warm regards.
Sources:
How to Set 410 Status Code in Bulk for WordPress » Rank Math
Solving Redirection Issues Using Rank Math SEO Plugin » Rank Math
I tried to follow the prompts and found that it didn’t work.
Could you tell me how to change the URL status code containing “?” and “/search/” to 410?
Hello,
Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.
You can create regex redirections on your website to set the 410 redirections for these URLs. Here’s how you can set a regex redirection on your website: https://rankmath.com/kb/how-to-use-regex-redirects/
If you want, you can also share some exact URLs with us so that we can assist you in creating the regex rule.
Looking forward to helping you.
Thank you.
Could you tell me how to change the URL status code containing “?” to 410?
Hello,
In order to redirect all the URLs with query parameters, you can use the following regex redirection:
Source: \?(.*)
Match: regex
Hope that helps and please don’t hesitate to let us know if you have any other questions.
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.