Extension:Add HTML Meta and Title
<translate> This extension is currently not actively maintained!</translate> <translate> Although it may still work, any bug reports or feature requests will more than likely be ignored.</translate> <translate> If you are interested in taking on the task of developing and maintaining this extension, [[<tvar name=request>Special:MyLanguage/Gerrit/Privilege policy#Requesting Gerrit privileges</tvar>|you can request repository ownership]].</translate> <translate> As a courtesy, you may want to contact the author.</translate> <translate> You should also remove this template and list yourself as maintaining the extension in the page's <tvar name=extension>{{Extension }}</tvar> infobox.</translate> |
Add HTML Meta and Title Release status: unmaintained |
|
---|---|
Implementation | Tag |
Description | Allows for easier SEO (search engine optimization) with MediaWiki. |
Author(s) | Jim Wilson, Dennis Roczek (dennisroczektalk) |
Latest version | 0.7 (2015-09-29) |
MediaWiki | 1.24+ |
Database changes | No |
License | MIT License |
Download | |
<seo> |
|
Quarterly downloads | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Public wikis using | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Translate the Add HTML Meta and Title extension if it is available at translatewiki.net |
The Add HTML Meta and Title extension allows for easier SEO (search engine optimization) with MediaWiki. It is based in part on the extension MetaKeywordsTag .
Usage
When you enter the following in a wiki page:
<seo title="word1,word2" metakeywords="word3,word4" metadescription="word5,word6" google-site-verification="123456789-abfd123456" />
...or the shorter...
<seo title="word1,word2" metak="word3,word4" metad="word5,word6" google-site-verification="123456789-abfd123456" />
...these words are added to the HTML title and meta headers. This makes SEO (search engine optimization) with MediaWiki easier.
For example, the above would become:
<title>word1,word2 - Wiki Name</title> (the string "word1,word2" replaces page title)
<meta name="keywords" content="word3,word4" />
<meta name="description" content="word5,word6" />
<meta google-site-verification="123456789-abfd123456" />
(These are new meta tags - existing metas are left untouched.)
Installation
- <translate> [[<tvar name=2>Special:ExtensionDistributor/AddHTMLMetaAndTitle</tvar>|Download]] and move the extracted <tvar name=name>
AddHTMLMetaAndTitle
</tvar> folder to your <tvar name=ext>extensions/
</tvar> directory.</translate>
<translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/AddHTMLMetaAndTitle - <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
wfLoadExtension( 'AddHTMLMetaAndTitle' );
- File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>
Changelog
- v0.7.0
- added support for PHP CodeSniffer checks.
- fixed any remaining errors and warnings.
- v0.6.0
- added Google's site verification tag.
- v0.5.1
- modified to work with MW versions 1.1.2 and up (Revision by Mic)
- v0.4.0
- have put
$emt="";
in the parseSEO function because I got some nasty PHP notice for an unitialised variable...
- v0.2.0
- added htmlspecialchars() as a filter to the text that is displayed in the title and meta - anything else needed to prevent malicious people? I think no. (If you are an English speaker you may want to use the htmlentities PHP function, which is more restrictive.)
- v0.1.0
- Initial version - everything works.
See also
- Extension:WikiSEO is based on this extension, but rewritten to modern MediaWiki standards and under active development.
- If you only want to override the title on pages (not append words to it), you might also look at the DISPLAYTITLE tag in combination with the Manual:$wgAllowDisplayTitle and Manual:$wgRestrictDisplayTitle settings.
- Extension:Semantic Meta Tags for easily setting meta and keywords on entire namespaces or individual pages
File:OOjs UI icon information-progressive.svg | <translate> This extension is included in the following wiki farms/hosts and/or packages:</translate>
<translate> This is not an authoritative list.</translate> <translate> Some wiki farms/hosts and/or packages may contain this extension even if they are not listed here.</translate> <translate> Always check with your wiki farms/hosts or bundle to confirm.</translate> |
- Pages with script errors
- Pages with broken file links
- Unmaintained extensions
- Extensions without an image
- Tag extensions
- Extensions without a compatibility policy
- Extensions with manual MediaWiki version
- MIT licensed extensions
- Extensions in Wikimedia version control
- ParserFirstCallInit extensions
- BeforePageDisplay extensions
- All extensions
- HTML head extensions
- Search engine optimization extensions