Adding NoIndex to Some Pages

JK Maken

New member
Hi,

I just did a search on my domain name on Google and realised that a few redundant pages are being indexed.

How can I add NoIndex Follow to the meta for the following types of pages:
  • mydomain.com/help/*
  • mydomain.com/search/*

URL such as the ones below are appearing in my Google index:
  • mydomain.com/search/member?user_id=1
  • mydomain.com/search/?type=profile_post
  • mydomain.com/help/bbcodes

Thanks!
 
Problem with adding noindex to some pages is that canonical tags will still be there. John Mueller said not to have a canonical tag and a noindex tag on the same page.

Question: after hours for investigation this issue (on different places) my idea is to add the following lines in template "thread_view":

Original:
Code:
<xen:container var="$head.canonical">
    <link rel="canonical" href="{xen:link 'canonical:threads', $thread, 'page={$page}'}" /></xen:container>

Substitution:
Code:
<xen:if is="in_array({$thread.node_id}, array(80,81))">
<xen:container var="$head.robots">
    <meta name="robots" content="noindex" /></xen:container>
<xen:else />
<xen:container var="$head.canonical">
    <link rel="canonical" href="{xen:link 'canonical:threads', $thread, 'page={$page}'}" /></xen:container>
</xen:if>

You agree? Can it be a solution to prevent canonical tags on "noindex" sites?
 
Top Bottom