2

A few days ago I was informed that my website appears when searching some random terms with a URL that, as far as I know, does not belong to it.

  • My domain: example.com
  • Search terms: "olympic"
  • Result listed: example.com/?threadmills-and-corn

When I click on the URL listed in the results it redirects me to the main page of my website.

Why are those URLs appearing in search?

  • While your question does not give us enough details to really know, it sounds like your site was hacked. It is not uncommon that websites are hacked and used to spam search results that then either deliver a payload (virus), redirect to another site or page, or deliver links or ads. This happens most commonly with a CMS (content management system) like WP (WordPress). It would help to know more about your situation, such as any CMS or software with version number, domain name, search terms, etc. – closetnoc Jul 22 '16 at 17:33
  • "it redirects me" - I assume it's not actually a "redirect" is it? It just displays the home page; query string ignored? Do you use a query string for anything? Do you have a rel="canonical" element? – MrWhite Jul 22 '16 at 17:51
  • ...just to add, if it was a "redirect", you shouldn't be getting these results in the SERPs. – MrWhite Jul 22 '16 at 18:31
  • Is the search term relevant to your site? Or is both the search term and URL alien to your site? – MrWhite Jul 22 '16 at 23:08
  • Thanks for answering. w3dk You're right it is not a redirect it just displays the home page. And no, the search terms is completely alien to my site. – a25bedc5-3d09-41b8-82fb-ea6c353d75ae Jul 23 '16 at 1:10
1

This is a simple thing to fix.

It is done with robots.txt

User-agent: *
Disallow: /*?

This will help to block access to all URLs that include a question mark (?) (more specifically, any URL that begins with your domain name, followed by any string, followed by a question mark, followed by any string).

See: https://serverfault.com/questions/139487/meaning-of-disallow-in-robots-txt

Disclaimer: Use with EXTREME care.

Added:

As goes the immediate concern of removing these urls it would be best in my view to indicate to Google the updates on the robots.txt page via the dedicated robots.txt section on Google Search Console.

  • This does assume that you have no legitimate URLs with query strings that you want crawled/indexed. It also doesn't address the immediate concern of removing these URLs from search (blocking these URLs with robots.txt should eventually see these URLs dropped from the search results), nor why these URLs are appearing in search in the first place. – MrWhite Jul 22 '16 at 23:07
  • As goes the immediate concern of removing these urls it would be best in my view to indicate to Google the updates on the robots.txt page via the dedicated robots.txt section on Google Search Console. – Michael Jul 23 '16 at 18:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.