Jump to content
thirty bees forum
  • 0

Adding noindex to quick-order and search


Question

Posted

I am looking in a way to add:

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

on certain pages. I tried it with HTML Box pro but is toes not save this rule. 

 

Is there an other easy way to get this only added on certain pages in the header? Maybe an enhancement for next version?

9 answers to this question

Recommended Posts

  • 0
Posted (edited)

well i use something like on index

{if $page_name == 'index'}
                              
 {/if}

or for categories

{if $page_name == 'category'}              

{if $smarty.get.id_category==1}

{elseif $smarty.get.id_category==2}

{elseif $smarty.get.id_category==3}
        

{else}        
{/if}             
{/if}

or for product via manufacturer

{if ($page_name == 'product')}


{if $product_manufacturer->id==1 }

{elseif $product_manufacturer->id==2 }

{elseif $product_manufacturer->id==3 }

{else}
    
{/if}

{/if}

and so on

Edited by MichaelEZ
  • Like 1
  • 0
Posted

As I am 😉

well u can go to your theme folder, find header.tpl and past code right there in meta tags, but on which pages do u want have that meta tag turned on? 

  • 0
Posted

Just search and quick-order so respectively I think:

order-opc.tpl and search.tpl I guess... We use one page checkout.

  • 0
Posted (edited)

Find meta tags in header.tpl and add

 

      {if ($page_name == 'search')}    <meta name=”robots content=”noindex,follow”/>   {/if}

     {if ($page_name == 'order-opc')}    <meta name=”robots content=”noindex,follow”/>   {/if}


    

 

Edited by MichaelEZ
  • Thanks 1
  • 0
Posted (edited)

Just a small issue did arise... I got now double robots tags...

 

image.png

Is there a way to solve this also in TB? Or do i have to exclude this one then on certain pages?

Or are we missing some setting somewhere? This is generating the top line.

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

 

Edited by Smile
  • 0
Posted
4 hours ago, Smile said:

Just a small issue did arise... I got now double robots tags...

 

image.png

Is there a way to solve this also in TB? Or do i have to exclude this one then on certain pages?

Or are we missing some setting somewhere? This is generating the top line.


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

 

Include the top line into your expression. Something like this should do the trick

{if ($page_name == 'search' || $page == 'order-opc')}    
  <meta name=”robots content=”noindex,follow” />
{else}
  <meta name="robots" content="{if isset($nobots)}no{/if}index,{if isset($nofollow) && $nofollow}no{/if}follow" />
{/if}
  • 0
Posted (edited)

Thanks, this is a perfect solution! Just made a small fix:

	{if ($page_name == 'search' || $page_name == 'order-opc')}
        <meta name="robots" content="noindex,follow" />
        {else}
        <meta name="robots" content="{if isset($nobots)}no{/if}index,{if isset($nofollow) && $nofollow}no{/if}follow" />
        {/if}

 

Edited by Smile

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...