You are here:  » wordpress noindex


wordpress noindex

Submitted by ccgale on Wed, 2014-04-30 20:45 in

Hi David

Is it possible to noindex the product pages but keep the search pages open for indexing with the wordpress plugin? I found the code on here to noindex the product pages but that seems to be blocking the bots from my search results too.

Thanks,
Carl

Submitted by support on Thu, 2014-05-01 08:35

Hi Carl,

Sure - in pto.php look for the following code at line 366:

  print "<meta name='description' content='".htmlentities($description,ENT_QUOTES,get_settings("blog_charset"))."' />\n";

...and REPLACE with:

  print "<meta name='description' content='".htmlentities($description,ENT_QUOTES,get_settings("blog_charset"))."' />\n";
  print "<meta name='robots' content='noindex' />";

Note that this would apply to the product _and_ review pages (if using). If you are using reviews and only want noindex to apply to product pages then instead of the above, look for the following code at line 320:

    case "product":
    case "review":

...and REPLACE with:

    case "product":
      print "<meta name='robots' content='noindex' />";
    case "review":

Cheers,
David.
--
PriceTapestry.com