Skip to content

Github mirror of MediaWiki extension AddHTMLMetaAndTitle - our actual code is hosted with Gerrit (please see https://www.mediawiki.org/wiki/Developer_access for contributing

License

Notifications You must be signed in to change notification settings

wikimedia/mediawiki-extensions-AddHTMLMetaAndTitle

Repository files navigation

MW-MetaTitle

An fork of Add HTML Meta and Title extension for MediaWiki.

Instalation

Copy Add_HTML_Meta_and_Title.php into 'extensions' directory. Add following into your LocalSettings.php

$wgSitename = "My Wiki";  
$wgAllowDisplayTitle = true;  
$wgRestrictDisplayTitle = false;  
require_once "$IP/extensions/Add_HTML_Meta_and_Title/Add_HTML_Meta_and_Title.php';

Usage

<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>Original title, word1,word2</title>         (the string ", word1,word2,..." is added)
<meta name="keywords" content="word3,word4" />
<meta name="description" content="word5,word6" />
<meta name="google-site-verification" content="123456789-abfd1234562 />

(These are new meta tags - existing meta tags are left untouched.)

Useful hint

Create a template called Seo, insert following wikitext.

{{DISPLAYTITLE:{{{pagetitle}}} }}
<seo title={{{pagetitle}}} metakeywords="{{{meta_keywords}}}"/>

Now you can use more Wiki-flavoured style like following.

{{seo
|pagetitle=My Main Page
|meta_keywords=super,long,increase,inches}}

Changelog

08.06.2012 - version 0.5 - MediaWiki v1.19 support 17.05.2015 - version 0.5.2 - using new i18n system 17.05.2015 - version 0.6 - add support for google-site-verification

About

Github mirror of MediaWiki extension AddHTMLMetaAndTitle - our actual code is hosted with Gerrit (please see https://www.mediawiki.org/wiki/Developer_access for contributing

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published