PHPackages                             octfx/wiki-seo - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. octfx/wiki-seo

ActiveMediawiki-extension[Utility &amp; Helpers](/categories/utility)

octfx/wiki-seo
==============

Allows per page meta settings like keywords and description, changing the title and various site verification tags.

v2.7.0(2y ago)82.6k8GPL-2.0+PHPPHP &gt;=7.4

Since Nov 10Pushed 2mo ago18 watchersCompare

[ Source](https://github.com/wikimedia/mediawiki-extensions-WikiSEO)[ Packagist](https://packagist.org/packages/octfx/wiki-seo)[ Docs](http://www.mediawiki.org/wiki/Extension:WikiSEO)[ RSS](/packages/octfx-wiki-seo/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (35)Used By (0)

MediaWiki WikiSEO extension
===========================

[](#mediawiki-wikiseo-extension)

**Starting from 2023-01-23, WikiSEO requires MediaWiki 1.39.0**

The WikiSEO extension allows you to replace, append or prepend the html title tag content, and allows you to add common SEO meta keywords and a meta description.

**Extension Page: [Extension:WikiSEO](https://www.mediawiki.org/wiki/Extension:WikiSEO)**

Installation
------------

[](#installation)

- [Download](https://www.mediawiki.org/wiki/Special:ExtensionDistributor/WikiSEO) and place the file(s) in a directory called WikiSEO in your extensions/ folder.
- Add the following code at the bottom of your [LocalSettings.php](https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:LocalSettings.php):

```
wfLoadExtension( 'WikiSEO' );

```

- Configure as required.
- Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration
-------------

[](#configuration)

The following variables are in use by this extension.

VariableDescriptionUsageSite / App Keys$wgGoogleSiteVerificationKeySetting this variable will add a `` tag to every page.$wgGoogleSiteVerificationKey = 'CODE';$wgBingSiteVerificationKeySetting this variable will add a `` tag to every page.$wgBingSiteVerificationKey= 'CODE';$wgFacebookAppIDSetting this variable will add a `` tag to every page.$wgFacebookAppID= 'App\_ID';$wgFacebookAdminsSetting this variable will add a `` tag to every page.$wgFacebookAdmins= 'ID1,ID2,...';$wgYandexSiteVerificationKeySetting this variable will add a `` tag to every page.$wgYandexSiteVerificationKey= 'CODE';$wgPinterestSiteVerificationKeySetting this variable will add a `` tag to every page.$wgPinterestSiteVerificationKey= 'CODE';$wgNortonSiteVerificationKeySetting this variable will add a `` tag to every page.$wgNortonSiteVerificationKey= 'CODE';$wgNaverSiteVerificationKeySetting this variable will add a `` tag to every page.$wgNaverSiteVerificationKey = 'CODE';General Options$wgMetadataGeneratorsArray containing the metadata generator classes to load. Custom generators can be added by appending the class name without the namespace to this array.$wgMetadataGenerators = \["OpenGraph", "Twitter", "SchemaOrg"\]$wgTwitterSiteHandleOnly used when Twitter generator is loaded. Setting this variable will add a tag to every page.$wgTwitterSiteHandle = '@SITE\_HANDLE';$wgWikiSeoDefaultImageSet a default image to use if no image is set on the site. If this variable is not set the sites logo will be used.$wgWikiSeoDefaultImage = 'File:Localfile.jpg';$wgTwitterCardTypeDefaults to summary\_large\_image for the twitter card type.$wgTwitterCardType = 'summary';$wgWikiSeoDefaultLanguageA default language code with area to generate a for.$wgWikiSeoDefaultLanguage = 'de-de';$wgWikiSeoDisableLogoFallbackImageDisables setting $wgLogo as the fallback image if no image was set.$wgWikiSeoNoindexPageTitlesAn array of page titles where a 'noindex' robot tag should be added.$wgWikiSeoNoindexPageTitles = \[ 'Custom\_Title', 'Main\_Page' \];$wgWikiSeoEnableAutoDescriptionSet to true to try to request a description from textextracts, if no description was given, or the description key is set to 'textextracts' or 'auto'. This requires Extension:TextExtracts to be loaded. The description is generated when saving the page after an edit.$wgWikiSeoEnableAutoDescription = true;$wgWikiSeoTryCleanAutoDescriptionSet to true, if WikiSEO should try to remove dangling sentences when using descriptions from textextracts. This will remove all characters after the last found dot.$wgWikiSeoTryCleanAutoDescription = true;$wgWikiSeoOverwritePageImageSet to true to enable overwriting the iamge set by extension PageImages.$wgWikiSeoOverwritePageImage = true;Social Media Images$wgWikiSeoEnableSocialImagesGenerate dedicated social media icons for pages$wgWikiSeoEnableSocialImages = true;$wgWikiSeoSocialImageIconThe icon/watermark to add to the social media image. Use a local file name$wgWikiSeoSocialImageIcon = LocalFile.jpg;$wgWikiSeoSocialImageWidthWidth of the social media image$wgWikiSeoSocialImageWidth = 1200;$wgWikiSeoSocialImageHeightHeight of the social media image$wgWikiSeoSocialImageHeight = 620;$wgWikiSeoSocialImageTextColorColor of the text on the social image$wgWikiSeoSocialImageTextColor = #fff;$wgWikiSeoSocialImageShowAuthorShow the author of the current page revision$wgWikiSeoSocialImageShowAuthor = true;$wgWikiSeoSocialImageShowLogoShow the Wiki logo in the top right corner$wgWikiSeoSocialImageShowLogo = true;$wgWikiSeoSocialImageBackgroundColorDefault background color if no page image is foundUsage
-----

[](#usage)

The extension can be used via the `{{#seo}}` parser function or in Lua modules by using `mw.ext.seo`. It accepts the following named parameters in any order.

- title
    - The title you want to appear in the html title tag
- title\_mode
    - Set to append, prepend, or replace (default) to define how the title will be amended.
- title\_separator
    - The separator in case titlemode was set to append or prepend; " - " (default)
- keywords
    - A comma separated list of keywords for the meta keywords tag
- description
    - A text description for the meta description tag
- robots
    - Controls the behavior of search engine crawling and indexing
    - Assumes the following order: index policy, follow policy
    - Example: robots=index,nofollow / noindex,follow / index,follow / etc.
    - Invalid: robots=follow,index
- googlebot
    - Controls the behavior of the google crawler
- hreflang\_xx-xx\[\]
    - Adds `` elements +\* canonical

- - Adds a `` element

**Tags related to the Open Graph protocol**

- type
    - The type of your object, e.g., "video.movie". Depending on the type you specify, other properties may also be required.
- image
    - An image URL which should represent your object within the graph. The extension will automatically add the right image url, width and height if an image name is set as the parameter. Example `image = Local_file_to_use.png`. Alternatively a full url to an image can be used, image\_width and image\_height will then have to be set manually. If no parameter is set, the extension will use `$wgLogo` as a fallback or the local file set through `$wgWikiSeoDefaultImage`.
- image\_width
    - The image width in px. (Automatically set if an image name is set in image)
- image\_height
    - The image height in px. (Automatically set if an image name is set in image)
- image\_alt
    - Alternative description for the image.
- locale
    - The locale these tags are marked up in. Of the format language\_TERRITORY.
- site\_name
    - If your object is part of a larger web site, the name which should be displayed for the overall site. e.g., "IMDb".

**Tags related to Open Graph type "article"**

- author
    - Writers of the article.
- keywords
    - Translates into article:tag
- section
    - A high-level section name. E.g. Technology
- published\_time
    - When the article was first published. ISO 8601 Format.

**Tags related to Twitter Cards (see OpenGraph Tags)**

- twitter\_site
    - If you did not set a global site name through `$wgTwitterSiteHandle`, you can set a site handle per page. If a global site handle is set this key will be ignored.
- twitter\_card
    - Allows per page overriding of `$wgWikiSEOTwitterCardType`

**Tags related to the Citation generator**

- description
- keywords
- citation\_author
- citation\_conference\_title
- citation\_creation\_date (previously citation\_date\_created)
- citation\_doi
- citation\_firstpage (previously citation\_page\_start)
- citation\_headline
- citation\_isbn
- citation\_issn
- citation\_issue
- citation\_journal\_title
- citation\_lastpage
- citation\_license
- citation\_name
- citation\_pdf\_url
- citation\_publication\_date (previously citation\_date\_published)
- citation\_publisher
- citation\_title
- citation\_type
- citation\_volume

Multiple authors should be separated by `;`.

\*\* Tags related to the Dublin Core generator\*\*

- description
- title
- author
- locale
- site\_name
- dc.identifier.wikidata

Examples
--------

[](#examples)

### Adding static values

[](#adding-static-values)

```
{{#seo:
 |title=Your page title
 |titlemode=append
 |keywords=these,are,your,keywords
 |description=Your meta description
 |image=Uploaded_file.png
 |image_alt=Wiki Logo
}}

```

### Adding dynamic values

[](#adding-dynamic-values)

If you need to include variables or templates you should use the parser function to ensure they are properly parsed. This allows you to use Cargo or Semantic MediaWiki, with Page Forms, for data entry, or for programmatic creation of a page title from existing variables or content...

```
{{#seo:
 |title={{#if: {{{page_title|}}} | {{{page_title}}} | Welcome to WikiSEO}}
 |titlemode={{{title_mode|}}}
 |keywords={{{keywords|}}}
 |description={{{description|}}}
 |published_time={{REVISIONYEAR}}-{{REVISIONMONTH}}-{{REVISIONDAY2}}
}}

```

```
{{#seo:
|title_mode=append
|title=Example SEO Wiki
|keywords=WikiSEO, SEO, MediaWiki
|description=An example description for this wiki
|image=Wiki_Logo.png
|image_alt=Wiki Logo
|site_name=Example SEO Wiki
|locale=en_EN
|type=website
|modified_time={{REVISIONYEAR}}-{{REVISIONMONTH}}-{{REVISIONDAY2}}
|published_time=2020-11-01
}}

```

### Using the lua module

[](#using-the-lua-module)

WikiSEO exposes a lua method as `mw.ext.seo.set`

Example module:

```
-- Module:SEO
local seo = {}

--[[
argTable format:
{
  title_mode = 'append',
  title = 'Example Seo Wiki',
  keywords = 'WikiSEO, SEO, MediaWiki',
  -- ...
}
]]--
function seo.set( argTable )
  mw.ext.seo.set( argTable )
end

function seo.setStatic()
  mw.ext.seo.set{
    title_mode = 'append',
    title = 'Example Seo Wiki',
    keywords = 'WikiSEO, SEO, MediaWiki',
  }
end

return seo
```

The module would now be callable as `{{#invoke:SEO|add|title=ExampleTitle|keywords=WikiSEO, SEO, MediaWiki}}` or `{{#invoke:SEO|addStatic}}`.

### Hreflang Attributes

[](#hreflang-attributes)

```
{{#seo:
 |hreflang_de-de=https://example.de/page
 |hreflang_nl-nl=https://example.nl/page-nl
 |hreflang_en-us=https://website.com/
}}

```

Will generate the following `` elements:

```

```

Title Modes
-----------

[](#title-modes)

Example: Page with title `Example Page`

### Append

[](#append)

```
{{#seo:
 |title_mode=append
 |title=Appended Title
}}

```

HTML Title result: `Example Page - Appended Title`

### Prepend

[](#prepend)

```
{{#seo:
 |title_mode=prepend
 |title=Prepended Title
}}

```

HTML Title result: `Prepended Title - Example Page`

### Prepend (changed separator)

[](#prepend-changed-separator)

```
{{#seo:
 |title_mode=prepend
 |title=Prepended Title
 |title_separator=&nbsp;>>&nbsp;
}}

```

HTML Title result: `Prepended Title >> Example Page`

### Replace (default)

[](#replace-default)

```
{{#seo:
 |title_mode=replace
 |title=Replaced Title
}}

```

HTML Title result: `Replaced Title`

Hooks
-----

[](#hooks)

WikiSEO exposes Hooks that allow to customize the metadata that gets added to the page and saved in page props.

- `WikiSEOPreAddMedatada`
    - `onWikiSEOPreAddMedatada( &$metadata )`
    - An array of key-value pairs validated through `Validator::validateParams`
    - Run right before the instantiation of the metadata generators
- `WikiSEOPreAddPageProps`
    - `onWikiSEOPreAddPageProps( &$metadata )`
    - An array of key-value pairs validated through `Validator::validateParams`
    - Run right before setting the page props
- `WikiSEOLuaPreAddPageProps`
    - `onWikiSEOLuaPreAddPageProps( &$metadata )`
    - An array of key-value pairs validated through `Validator::validateParams`
    - Run right before setting the page props
    - Only run when the lua module is called | $wgWikiSeoSocialImageBackgroundColor = #14181f; |

Migrating to v2
---------------

[](#migrating-to-v2)

### Removed tags

[](#removed-tags)

- DC.date.created
- DC.date.issued
- google
- name
- og:title (automatically set)
- og:url (automatically set)
- twitter:card (automatically set)
- twitter:creator
- twitter:domain
- article:modified\_time / og:updated\_time (automatically set)

### Removed aliases

[](#removed-aliases)

- metakeywords / metak
    - use keywords instead
- metadescription / metad
    - use description instead
- titlemode / title mode
    - use title\_mode instead

### Changed argument names

[](#changed-argument-names)

- article:author -&gt; author
- article:section -&gt; section
- article:tag -&gt; keywords
- article:published\_time -&gt; published\_time
- og:image / twitter:image:src -&gt; image
- og:image:width -&gt; image\_width
- og:image:height -&gt; image\_height
- og:locale -&gt; locale
- og:site\_name -&gt; site\_name
- og:title -&gt; title
- og:type -&gt; type
- twitter:description -&gt; description

Known Issues
------------

[](#known-issues)

[Extension:PageImages](https://www.mediawiki.org/wiki/Extension:PageImages) will add an og:image tag if an image is found on the page. This overwrites any og:image tag set using this extension.
There is currently no way to disable PageImages setting the meta tag.

Notes
-----

[](#notes)

If you only want to override the display title on pages (not append words to it), you might also look at the DISPLAYTITLE tag in combination with the [Manual:$wgAllowDisplayTitle](https://www.mediawiki.org/wiki/Manual:$wgAllowDisplayTitle) and [Manual:$wgRestrictDisplayTitle](https://www.mediawiki.org/wiki/Manual:$wgRestrictDisplayTitle) settings.

### schema.org

[](#schemaorg)

The `SchemaOrg` generator will set a SearchAction property based on Special:Search.
The properties publisher and author will be set to Organization with the name set to the content of `$wgSitename`.
`dateModified` will be automatically set by fetching the latest revision timestamp. If no published\_time is set, datePublished will be set to the latest revision timestamp.

### OpenGraph

[](#opengraph)

`article:modified_time` will be automatically set by fetching the latest revision timestamp. If no `published_time` is set, `article:published_time` will be set to the latest revision timestamp.
This can be disabled on a per-page basis by setting `modified_time=-` through the parser.

Extending this extension
------------------------

[](#extending-this-extension)

Metadata generators live in the `includes/Generator/Plugins` directory.
A generator has to implement the `GeneratorInterface`.
To load the generator simply add its name to `$wgMetadataGenerators`.

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance56

Moderate activity, may be stable

Popularity28

Limited adoption so far

Community28

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~157 days

Recently: every ~224 days

Total

21

Last Release

1055d ago

Major Versions

1.2.2 → v2.0.22019-10-10

PHP version history (4 changes)1.2.0PHP &gt;=5.3.0

v2.4.0PHP &gt;=7.1

v2.6.2PHP &gt;=7.2

v2.7.0PHP &gt;=7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6594492?v=4)[H. C. Kruse](/maintainers/Octfx)[@octfx](https://github.com/octfx)

---

Top Contributors

[![octfx](https://avatars.githubusercontent.com/u/6594492?v=4)](https://github.com/octfx "octfx (170 commits)")[![translatewiki](https://avatars.githubusercontent.com/u/24829418?v=4)](https://github.com/translatewiki "translatewiki (106 commits)")[![andru](https://avatars.githubusercontent.com/u/30393?v=4)](https://github.com/andru "andru (39 commits)")[![umherirrender](https://avatars.githubusercontent.com/u/1174884?v=4)](https://github.com/umherirrender "umherirrender (18 commits)")[![porplemontage](https://avatars.githubusercontent.com/u/32039243?v=4)](https://github.com/porplemontage "porplemontage (7 commits)")[![kghbln](https://avatars.githubusercontent.com/u/1104078?v=4)](https://github.com/kghbln "kghbln (6 commits)")[![paladox](https://avatars.githubusercontent.com/u/5727000?v=4)](https://github.com/paladox "paladox (5 commits)")[![samwilson](https://avatars.githubusercontent.com/u/213655?v=4)](https://github.com/samwilson "samwilson (5 commits)")[![ZabeMath](https://avatars.githubusercontent.com/u/35405030?v=4)](https://github.com/ZabeMath "ZabeMath (3 commits)")[![cscott](https://avatars.githubusercontent.com/u/156080?v=4)](https://github.com/cscott "cscott (3 commits)")[![reedy](https://avatars.githubusercontent.com/u/67615?v=4)](https://github.com/reedy "reedy (3 commits)")[![RhinosF1](https://avatars.githubusercontent.com/u/46229976?v=4)](https://github.com/RhinosF1 "RhinosF1 (3 commits)")[![Universal-Omega](https://avatars.githubusercontent.com/u/54654040?v=4)](https://github.com/Universal-Omega "Universal-Omega (2 commits)")[![jdforrester](https://avatars.githubusercontent.com/u/881572?v=4)](https://github.com/jdforrester "jdforrester (2 commits)")[![kizule](https://avatars.githubusercontent.com/u/28963303?v=4)](https://github.com/kizule "kizule (2 commits)")[![dringsim](https://avatars.githubusercontent.com/u/57343841?v=4)](https://github.com/dringsim "dringsim (2 commits)")[![amire80](https://avatars.githubusercontent.com/u/346271?v=4)](https://github.com/amire80 "amire80 (1 commits)")[![cougrimes](https://avatars.githubusercontent.com/u/10158661?v=4)](https://github.com/cougrimes "cougrimes (1 commits)")[![SomeMWDev](https://avatars.githubusercontent.com/u/186634068?v=4)](https://github.com/SomeMWDev "SomeMWDev (1 commits)")[![subbuss](https://avatars.githubusercontent.com/u/91608?v=4)](https://github.com/subbuss "subbuss (1 commits)")

### Embed Badge

![Health badge](/badges/octfx-wiki-seo/health.svg)

```
[![Health](https://phpackages.com/badges/octfx-wiki-seo/health.svg)](https://phpackages.com/packages/octfx-wiki-seo)
```

###  Alternatives

[rainlab/blog-plugin

Blog plugin for October CMS

17257.7k](/packages/rainlab-blog-plugin)[rainlab/builder-plugin

Builder plugin for October CMS

17147.2k1](/packages/rainlab-builder-plugin)[pfefferle/wordpress-activitypub

The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.

5671.4k1](/packages/pfefferle-wordpress-activitypub)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

18238.1k2](/packages/civicrm-civicrm-drupal-8)[mediawiki/semantic-glossary

A terminology markup extension with a Semantic MediaWiki back-end

1352.4k](/packages/mediawiki-semantic-glossary)[humanmade/lottie-lite

A lightweight Lottie Animations Extension for WordPress

374.3k](/packages/humanmade-lottie-lite)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
