2

Google is indexing all kinds of spammed internal search results from my wordpress site, and I can't figure out how to put a stop to it. I added Disallow: /search/ to my robots.txt file, but that didn't stop google. They still index them, but now they say "Indexed, though blocked by robots.txt"

What can I do to stop these from being indexed? And how do they even show up for google? Is there somewhere within wordpress that these are being stored that google is picking them up from?

Any help would be much appreciated!

Here's what I see in google search console:

enter image description here

Jon Fergus
  • 41
  • 2

1 Answers1

2

You also need to add noindex meta tag in the template page where your search result is dynamically rendered.

<meta name="robots" content="noindex" />

Usually, a CMS like WordPress uses a template page that dynamically renders the search result in your website. You need to add that no index meta tag in to that template page. However, please make sure that template is only for the search result pages to not affect other pages.

Jhun A.
  • 86
  • 5