Jump to content

[Solved] How can i set "noindex" on different pages


Recommended Posts

So if i understand it correctly i need to put both

 

{if $page_name=='index'}

<meta name="robots" content="{if isset($nobots)}no{/if}index,follow" />

{/if}

 

And

 

{if $page_name=='cart'}

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

{/if}

 

in the header.tpl?

 

And then i need to type in all the pages (card, best-sales, new-products........) in the two codes?

Link to comment
Share on other sites

Update!

 

I found a much easyer way :)

 

I used:

 

{if $page_name=='best-sales'}

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

{elseif $page_name=='new-products'}

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

{else}

<meta name="robots" content="index,follow" />

{/if}

 

Then i only have to add the pages i want "noindex" on, and then i use {else} for all other pages :)

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

{if $page_name=='best-sales'}

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

{elseif $page_name=='new-products'}

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

{else}

<meta name="robots" content="index,follow" />

{/if}

 

above codes works on pages only provides pages names are non-friendly url and it does not work on module pages?

 

Suggestion, turn off friendly url then note down the pages names you dont want index,follow on, test the codes then turn seo friendly urls on

 

What can be done for module pages noindex?

Link to comment
Share on other sites

I want to put this page in noindex:

 

/ modules / maofree_askmoreinfo / askmoreinfo_form.php? id_product = 559

 

If I use:

 

{if $ page_name == 'askmoreinfo_form'}

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

{else}

<meta name="robots" content="index,follow" />

{/ if}

 

It does not work.

askmoreinfo_form could be because it is not in the root and is part of a module?

 

Thanks to all

Link to comment
Share on other sites

  • 2 months later...
  • 11 months later...

All you have to do is add the pages to your Robots.txt file and block it there disallow: /best-sale

no need to go to the script. If robots text is blocking the page than it does not matter what tags are in the page itself. You also dont need the follow tag if the page is blocked because there is no page rank for the page anyways because its blocked.

Link to comment
Share on other sites

  • 8 months later...

Hi all


Just tried of trying to add <meta name="robots" content="noindex, nofollow" /> in certain cms pages. 


I did add all these codes in header .tpl but none of these worked.


 


"{if $page_name=='cms.php?id_cms=12'}

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

{else}

<meta name="robots" content="{if isset($nobots)}no{/if}index,follow" />

{/if} "


 


{if $page_name=='/content/12-links"}

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

{else}

<meta name="robots" content="{if isset($nobots)}no{/if}index,follow" />

{/if}

 


{if $page_name=='links"}

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

{else}

<meta name="robots" content="{if isset($nobots)}no{/if}index,follow" />

{/if}

 


 

{if $_SERVER['REQUEST_URI']=='/content/12-links'}

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

{else}

<meta name="robots" content="{if isset($nobots)}no{/if}index,follow" />

{/if}

 


This post is solved but the solutions are not working.

 

My store  version 1.4.7.3

 

prestashop really need to put these kinds of basic features and yet these features are still not available in 1.5 and also in 1.6 i guess.


Link to comment
Share on other sites

  • 1 month later...

 

Hi all

Just tried of trying to add <meta name="robots" content="noindex, nofollow" /> in certain cms pages. 

I did add all these codes in header .tpl but none of these worked.

 

[...]

 

This post is solved but the solutions are not working.
 
My store  version 1.4.7.3
 
prestashop really need to put these kinds of basic features and yet these features are still not available in 1.5 and also in 1.6 i guess.

 

 

This will work:

{if strpos($page_name, "a_part_of_url_page") !== false}
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
{/if}

This one search for a word that is a part of $page_name, and write instructions when found. If not sure what prints out $page_name in a particular page, simple try before {$page_name} and see what match for you ;)

Link to comment
Share on other sites

  • 3 months later...

hi ,
how can i add noindex  & nofollow in particular CMS page Like {* /content/9-featured-products-blog *} and particular CATEGORY page Like {* /30-testing*} In PrestaShop V. 1.5.6
Please Help
thank you

Link to comment
Share on other sites

  • 1 year later...

Here is the perfect module for you all those are in need to use NOINDEX or NOFOLLOW options on different pages for better SEO.

SEO NOindex,follow (handles Duplicate content) Module

Features:

- Canonical url for Category, New Product, Top Sellers, Price Drop, Suppliers, Manufacturers,  pagination (?p=1,p=2..) to avoid duplicate content for SEO.
Optimize search results for all search engines
-  Get rid of mass indexing for unnecessary pages.
-  Set FOLLOW/ NOFOLLOW option for each page.
-  Set INDEX/ NOINDEX option for each page.
-  Set INDEX & FOLLOW options for Categories, Products, CMS, CMS Categories, Default and Modules pages.
- Select YES/ NO All and UNDO buttons to set options quickly.
- Update ROBOTS.TXT file from module configuration directly.

 

post-393849-0-03777900-1454328050_thumb.png

post-393849-0-36393200-1454327931_thumb.png

Edited by srana
solution is updated. (see edit history)
Link to comment
Share on other sites

  • 8 months later...
  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...