Jump to content
thirty bees forum
  • 0

Adding noindex to quick-order and search


Smile

Question

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?

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

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
Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0
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}
Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

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