Wordpress internal search and spam searches


I’ve noticed on my Wordpress site some bots are doing spam searches which create pages like:


This flagged up when I signed up with Ezoic and they had the below displayed:

This only happens through the internal search function, the rest of the site is fine (I did check for malware etc)

Is there a way for me to stop my Wordpress saving search result pages? Also, how could I go about deleting the pages already created?

I’ve tried searching in Google how to resolve this but I can’t seem to pinpoint articles related to specifically the internal site search function.

Any help would be appreciated.

I am going to guess that you mean through the regular search results page of a WordPress site. But as far as I know, this isn’t saving the search results anywhere. I don’t see a table for it in WordPress. Where are you seeing the actual saved searches?

Thanks for responding.

I think I’m being an idiot :slight_smile: After looking into it some more I think what is happening is that someone/bot must have submitted a URL to Google for a search results page on my website. I hadn’t realised you could just paste a URL into a browser and it would load the live search results (I assumed you could only load the search results if you used the search box on the site). What I am seeing are live internal search queries for each URL rather than individual pages. I did a search on google for some of the spam search text and it did load a few other Wordpress sites who have the same issue.

When I search Google for my domain + ‘pharmacy’ it brings up 1 result however Ezoic’s program seems to have over 50 URLs (all to the search result page).

I think all I can do is try to find a way to stop any pages with /?s= in the url not to be indexed/added to the sitemap. I’m hoping that should resolve the issue.

Ok yeah that is often a common problem and not just with WordPress. Bots can link to some page on a site and load garbage through a parameter and it will show up in things like google analytics and such. If Google finds one of these links on a site, comes to your page through that link and it lands on some sort of legitimate page (like your search results page) it doesn’t realize it is a bad URL.

One thing you can do, which involves a little programming in WordPress, is to check if the referring site is coming from some address other than your site and supplying that “s” parameter and simply forward them on to a 404 page. This is assuming that your searches are going to only be conducted on your site through your search box. In other words, if “s” is specified and the referrer is not yoursite.com then route to 404.

At least in that case if Google is following a link directly, it should get the 404 and not index the bad link. Now of course if you want other sites to be able to link directly to search results, this wouldn’t work.


1 Like

That’s great, thanks Martyr2!

I don’t direct link to any searches anywhere so using the 404 option seems like it could be a good option. Would you know if there would be any SEO implications if I end up having lots of links redirecting to the 404 page? I don’t know how many of these links could be submitted so I’m a little concerned that potentially it could be 100s.

Also, if I did go with the 404 option would you know of any guide/info pages I could look at on how to complete this? I’ve tried searching but I can’t seem to find anything which also covers the additional element of checking to see if they are coming from my site.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.