Robots meta tag

chrism2671 - May 14, 2008 - 10:28
Project:Wikitools
Version:5.x-1.2
Component:Code
Category:feature request
Priority:critical
Assigned:Unassigned
Status:active
Description

All 'page does not exist' pages are indexed by google, resulting in potentially thousands of pages of search engine spam.

This page needs to have the 'robots' meta tag set in the of the document to 'noindex,nofollow' (see wikipedia's version of this page for an example).

This is a particularly important patch for the SE conscious.

#1

groovypower - June 26, 2008 - 23:01

Have not tried it yet, but was wondering if this could just be added to the function theme_wikitools_page_does_not_exist? Not sure if you can add to the header from a theme function or if you even need to.

#2

chrism2671 - July 1, 2008 - 08:47

It's worked for google to put this tag into the of the document, which I've done with a simple hack, but as with all these things, it's better if it's done properly.

#3

groovypower - July 1, 2008 - 13:10

Do you mind sharing the hack?

#4

chrism2671 - July 3, 2008 - 08:57

As I recall, if you just find the 'page not found' function in the wikitools code and have it dump the meta tag in with the output for that page it seems to work.

#5

groovypower - July 3, 2008 - 12:02

That will dump the meta tag in the body not the header which I believe could invalidate the page and make the spiders more confused.

I finally found a snippet, add to the first line of the function

drupal_set_html_head('<meta name="robots" content="noindex,nofollow" />')

#6

chrism2671 - July 4, 2008 - 09:41

Oh brilliant I will try that out later! That should really be part of the next release...

 
 

Drupal is a registered trademark of Dries Buytaert.