UseModWiki | WikiPatches | RecentChanges | Preferences

This patch is included in 1.0. --CliffordAdams

Note, Google now downrates meta keywords, so you should disable it to increase your PageRank?. -- SunirShah

Split the title into separate words and put them in a MeatBall:MetaTag so that search engines may index the site more intelligently. -- SunirShah


Add $MetaKeywords to use vars qw().

 # Minor options: 
 $MetaKeywords = 1;      # 1 = Google-friendly,    0 = search-engine averse

 sub GetHtmlHeader {
   $html .= "<HTML><HEAD><TITLE>$title</TITLE>\n";
   if( $MetaKeywords ) {
       my $keywords = $OpenPageName;
       $keywords =~ s/([a-z])([A-Z])/$1, $2/g;
       $html .= "<META NAME='KEYWORDS' CONTENT='$keywords'/>\n" if $keywords;

       $html .= "<META NAME=\"KEYWORDS\" CONTENT=\"$keywords\">\n" if $keywords;
This looks better in HTML code. --BernhardZechmann

A long time ago I was told that whatever you do nothing on a cgi page would ever be indexed. The explanation was that all search engines refuse to handle any url with a ? in it. Has that changed? was it always wrong? I do hope I am wrong, as it would be nice to have the option of being visible to Google --RiVer

When their indexing capacity was limited, they didn't gather cgi-generated htmls, but recent web robots gather cgi-generated htmls. Some robots mind the meta tag and robots.txt file, but others don't. If u want to block some cgi from robots, you can check the user-agent variable.

See http://sunir.org/apps/refers.pl. Normally Google is the number one referrer. -- SunirShah

Assuming that times have changed and there is any point at all in producing METAs, I'd like to make two alternative suggestions

Simple idea: allow the meta tag to be placed on the wiki page, then the user can index whatever keywords they want. And, more to the point, pages are only indexed when the user so wishes. If I read your code correctly it will index every page. This would be somewhat along the lines of the following (untested) code

$pagetext =~ /^(<META  *NAME=KEYWORDS  *CONTENT=.*?>)/; 
$html .= $1;
Or, maybe you don't want to give users HTML (too hard for newbies, too dangerous for sneaky hackers) then I suggest new wiki tag <SEARCHKEYS blah> with the (untested) code
$pagetext =~ /^<SEARCHKEYS\s\s*(.*?)\s*>//;
$keywords = $1;
$keywords =~ /=.*//;  #makes sneaky hack stuff innocuous
if ($keywords) {
  $keywords =~ s/([a-z])([A-Z])/$1, $2/g;
  $html .= "<META NAME='KEYWORDS' CONTENT='$keywords'/>\n";
Just ideas...

(PS $pagetext is not the correct variable name, maybe I'll correct it later but fel free to do so yourself)


Don't add more pointy brackets. That's just annoying. Even the #REDIRECT idiom is annoying because it conflicts with ordered list syntax. Instead, use the LinkPattern:

MetaKeywords: this, is, a, list, of, keywords

This is the beginning of the document. Notice now MetaKeywords is on the first line by itself. Don't emit that.

Sure this screws over the free link people, but... wait, I don't care. ;) -- SunirShah

Please don't call them MetaKeywords? - one of the nice things about wiki markup is it is not so geeky looking as HTML. I strongly agree that means no pointy brackets, but it also means we don't use words like META. Suggestions would therefore be

 SearchKeys?: this, is, another, list
 SearchEngines?: and, so, is, this

A way to allow keyword searches with no modification to the program is to use tight spacing:


Then search with prepended commas, so you can find a patch by searching for ",upgrade" without getting every page that uses "upgrade" in its text -- only keywords have leading commas. --JerryMuelver

I've converged my syntax hacks into a square bracket syntax, so in Domesu's (still unbuilt within a single codebase) squaretags syntax, it would look like [%keywords list of keywords here] (All "compile time" metadata uses the syntax [%name val1 val2 ... valn]). They can be put anywhere in the page, as it assembles them all when the page is submitted. Bottom of page is recommended. --ChuckAdams

UseModWiki | WikiPatches | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited January 28, 2008 8:13 pm by JuanmaMP (diff)