Page 1 of 1

shield plugin (freetag sidebar) by User-Agent

Posted: Tue Feb 12, 2008 3:51 pm
by Maex
Is it possible to shield a plugin (freetags) depending on User-Agent?

For search engines, with a rather large tag cloud on each page the rating for the page rapidly decreases (too much keywords) and with all the same keywords on all the pages the blog pages become rather similar from the view of a search engine spider so the pages (and sometimes the whole (sub-)domain have a high potential ending up e.g. in googles supplementary index.

so i'd like to shield the plugin to not show up if e.g. googlebot retrieves the page(s).

I know I can hack the plugin (did this for gallery2) but I am curious if there is a more general approach, as this may also affect other plugins as well.

Thanks,

\Maex

Re: shield plugin (freetag sidebar) by User-Agent

Posted: Tue Feb 12, 2008 3:54 pm
by garvinhicking
Hi!

I believe that google and the likes have HTML tages like <noindex>...</noindex> (and a XHTML variant) that can shield portions of your webpage.

You could create an event plugin to filter out those plugins (like the 'serendipity_event_sidebarhider' plugin already does depeding on category view or user permissions), or also use Smarty templating markup to do it. (use {if} checks inside the sidebar.tpl file to check for the currently iterated sidebar item title and also check $smarty.SERVER.HTTP_USER_AGENT for a searchengine).

It's not something I'd recommend though because it involves coding and is not trivial.

Regards,
Garvin

Re: shield plugin (freetag sidebar) by User-Agent

Posted: Wed Feb 13, 2008 6:58 am
by Maex
garvinhicking wrote:Hi!
I believe that google and the likes have HTML tages like <noindex>...</noindex> (and a XHTML variant) that can shield portions of your webpage.
The only thing I know of in this area is Yahoo (and AFAIK only Yahoo) supporting a e.g. <div class="robots-nocontent">. See http://www.ysearchblog.com/archives/000444.html

Other instructions are possible via META tags, but have effect on the whole page. See http://www.robotstxt.org/meta.html

Never seen <noindex> and can't find any information with google.


I think I'll have a look at modifing the freetags plugin for now.

Thanks Garvin,

\Maex

Posted: Wed Feb 13, 2008 2:54 pm
by judebert
According to Wikipedia, Google advocates the use of nofollow (http://en.wikipedia.org/wiki/Nofollow) to avoid internal spamlinking. Yahoo and MSN followed suit. This would be a fairly trivial modification to the tag plugin.