Extension:MetaKeywordsTag

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual
Crystal Clear action run.png
MetaKeywordsTag

Release status: beta

Implementation Tag
Description Extension tag for adding <meta> keywords to the document header.
Author(s) Jim R. Wilson (Jimbojwtalk)
Latest version 0.1
MediaWiki 1.6.x, 1.8.x, 1.9.x or higher
License The MIT License
Download MetaKeywordsTag.php

Translate the MetaKeywordsTag extension if it is available at translatewiki.net

Check usage and version matrix; code metrics

An extension tag which gives users the ability to inject custom <meta> keywords into the document header.

Note: The article Doing more with MediaWiki parser extensions contains a lengthy discussion of how this extension works.

Project Homepage
MetaKeywordsTag Extension - Jimbojw.com
Source Code
MetaKeywordsTag.php
Licensing
MetaKeywordsTag is released under The MIT License.

Installation[edit | edit source]

  1. Download MetaKeywordsTag, and be sure to rename the downloaded file to MetaKeywordsTag.php.
  2. Drop this script in $IP/extensions
    Note: $IP is your MediaWiki install directory.
  3. Enable the extension by adding this line to your LocalSettings.php:
    require_once('extensions/MetaKeywordsTag.php');
    

Usage[edit | edit source]

Once installed, editors of your wiki can add <meta> keyword tags by adding the following to the article text:

<keywords content="ListOfKeywords" />

Where ListOfKeywords would be replaced by the chosen meta keywords.

For example, the above would become:

<meta name="keywords" content="ListOfKeywords" />

Unofficial Version 0.3 for MW 1.18.0[edit | edit source]

If you are running a more recent version of MediaWiki and would like to add meta keywords, you can get source code for an updated version here. It is based on MetaDescriptionTag as modified by Choshi, which was based on the earlier version of MetaKeywordsTag. It works just like the above except the usage in your wiki page where the tags are now written:

<metakey>ListOfKeywords</metakey>

Where ListOfKeywords would be replaced by the chosen meta keywords.