Jump to content

Noindex/follow category links


lynnmcdee

Recommended Posts

 

Hello,

I wondered if anyone can help?  

At the moment my website has alot of categories and therefore there are alot of links on each webpage.  I would like the links from the category page to be noindex/follow so any 'link juice' is maintained the actual content is not looked at on that page. The actual products it is linked to will still be indexed and so no worries about blocking Google. 

The following code is in the template file.  Or, should I be looking at something else?

{if $SECTION_NAME=='category' AND $smarty.get.page > 1}
	<meta name="robots" content="noindex, follow" />
	{elseif $smarty.get.page == 'all'}
	<meta name="robots" content="noindex, follow" />
	{else}
	<meta name="robots" content="index, follow" />
	{/if}

 

Kind regards

Lynn

Link to comment
Share on other sites

Although, the Smarty reserved variable name of $smarty may work, it may also be misleading if you got the idea from the Smarty documentation site.

If things aren't working well, I would try: $GLOBALS['smarty'].get.page

Link to comment
Share on other sites

Thanks Brian.

It is now showing 

 {if $SECTION_NAME=='category' AND $GLOBALS['smarty'].get.page > 1}
    <meta name="robots" content="noindex, follow" />
    {elseif $smarty.get.page == 'all'}
    <meta name="robots" content="noindex, follow" />
    {else}
    <meta name="robots" content="index, follow" />
    {/if}

Unfortunately it has not worked :( 

Link to comment
Share on other sites

My experiments do show that $smarty is the correct variable. So, this should work:

{if $SECTION_NAME=='category' && $smarty.get.page > 1}
    <meta name="robots" content="noindex, follow" />
{elseif $smarty.get.page == 'all'}
    <meta name="robots" content="noindex, follow" />
{else}
    <meta name="robots" content="index, follow" />
{/if}

Because a template has been edited, you may need to clear the skin cache (admin, Maintenance, Rebuild tab).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...