2011-12-09 08:31:09

colak
Admin
omega
Real name: Yiannis
From: Cyprus
Known languages: el, en
Website

content based meta robot usage

Following the redesign of our sites a few months ago, we noticed that the search engines were listing content which was no longer populated. During the redesign we decided to go with sections and although categories are used, their pages are basically empty.

The code bellow – although it is scripted for our sites – can easily be adapted for anyone’s needs

<txp:if_search>
<meta name="robots" content="noindex,follow" />
<txp:else />
<txp:if_article_list><!-- article list page, either section or category -->
<txp:variable name="categoryname" value='<txp:page_url type="c" />' /> <!-- detect if you are in a category page -->
<txp:if_variable name="categoryname" value=""><!-- section home page -->
<txp:if_section name="sections,to,exclude,from,engines">
<meta name="robots" content="noindex,follow" />
<txp:else /><!-- remaining sections  to include in search engines-->
<meta name="robots" content="index,follow,noodp,noydir" />
<meta name="keywords" content="your, keywords, here" />
<meta name="revisit-after" content="4 days" />
</txp:if_section>
<txp:else /><!-- category page -->
<txp:if_category name="categories,to,exclude,from,engines">
<meta name="robots" content="noindex,follow" />
<txp:else /><!-- remaining categories  to include in search engines-->
<meta name="robots" content="index,follow,noodp,noydir" />
<meta name="keywords" content="your, keywords, here" />
</txp:if_category>
</txp:if_variable>
<txp:else /><!-- individual article page -->
<meta name="robots" content="index,follow,noodp,noydir" />
<meta name="revisit-after" content="20 days" />
<txp:meta_keywords />
</txp:if_article_list>
</txp:if_search>

Last edited by colak (2011-12-09 12:54:20)

Offline

 

2011-12-09 11:33:13

philwareham
Core designer
sigma
Real name: Phil Wareham
From: Farnham, UK
Website

Re: content based meta robot usage

Nice, thanks for sharing. You might also want to consider <meta name="robots" content="index, follow, noodp, noydir"> in the above code.

A good description of what ‘noodp’ and ‘noydir’ actually do.

Offline

 

2011-12-09 12:54:48

colak
Admin
omega
Real name: Yiannis
From: Cyprus
Known languages: el, en
Website

Re: content based meta robot usage

Thanks Phil,

I knew nothing about those. Added them above and in our sites.

Offline

 

Powered by FluxBB