WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I noticed in google that actually searches in my blog are getting indexed on multiple pages resulting in duplicate content. Suggestions on how to stop this? example



I was thinking paramaters in google, but would I put to ignore?

share|improve this question

Read this http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html

There are several WordPress SEO plugins that can help, http://wordpress.org/extend/plugins/search.php?q=canonical&sort=

share|improve this answer
yeah i got all in one seo but it doesnt seem to be including searches at all – derek Jun 11 '11 at 14:47

The real problem here is not duplicate content. The problem is that your search result get indexed which is wrong for SEO reasons. Search engines like Google explicitly ask to avoid search result pages to get indexed.

To avoid your Wordpress search result pages to get indexed in search engines, you have different options :

Easy way

Block access to robots by adding the following instruction in your /robots.txt files :

Disallow: *?s=*

This will prevent from bots to access any resources with ?s= in their URL.

Good way

Add a <meta name="robots" content="noindex, follow" /> in the <head> tag of your search result pages.

This will let bots access your search pages but will prevent from indexing.

With Wordpress SEO by Yoast plugin

Wordpress SEO by Yoast is a well known plugin for optimizing Wordpress for SEO and considered as the best SEO plugin for now by many SEO professionals (as I am).

This plugin add automatically the right <meta> on search result pages.

Without using a plugin

With header included

If you use the same header for different templates with get_header() function for instance, you will need to test if the current page is a search result page before adding the <meta> tag.

Here is the code to add in your header template (default: header.php) :

<?php if ( is_search() ) : ?>
    <meta name="robots" content="noindex, follow" />
<?php endif; ?>

Without header included

If you use a simple template with his own header, you can simply edit you search template search.php to add the <meta>tag in the <head>

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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