Extension:WikiSEO

The WikiSEO extension allows you to replace, append or prepend the HTML title tag content. It also allows you to add common SEO (Search Engine Optimization) meta elements such as "keywords" and "description".

A working JobQueue is absolutely required for this extension to function.

Usage
The extension can be used via the  parser function or in Lua modules by using. It accepts the following named parameters in any order.


 * The title you want to appear in the html title tag
 * The title you want to appear in the html title tag


 * Set to append, prepend, or replace (default) to define how the title will be amended.
 * Set to append, prepend, or replace (default) to define how the title will be amended.


 * The separator in case titlemode was set to append or prepend; " - " (default)
 * The separator in case titlemode was set to append or prepend; " - " (default)


 * A comma separated list of keywords for the meta keywords tag
 * A comma separated list of keywords for the meta keywords tag


 * A text description for the meta description tag
 * A text description for the meta description tag


 * Controls the behavior of search engine crawling and indexing
 * Controls the behavior of search engine crawling and indexing


 * Controls the behavior of the google crawler
 * Controls the behavior of the google crawler


 * Adds  elements
 * Adds  elements


 * tags related to the Open Graph protocol
 * The type of your object, e.g., "video.movie". Depending on the type you specify, other properties may also be required.
 * The type of your object, e.g., "video.movie". Depending on the type you specify, other properties may also be required.


 * 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 . Alternatively a full url to an image can be used,   and   will then have to be set manually. If no parameter is set, the extension will use   as a fallback or the local file set through.
 * 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 . Alternatively a full url to an image can be used,   and   will then have to be set manually. If no parameter is set, the extension will use   as a fallback or the local file set through.


 * The image width in px. (Automatically set if an image name is set in )
 * The image width in px. (Automatically set if an image name is set in )


 * The image height in px. (Automatically set if an image name is set in )
 * The image height in px. (Automatically set if an image name is set in )


 * Alternative description for the image.
 * Alternative description for the image.


 * The locale these tags are marked up in. Of the format language_TERRITORY.
 * The locale these tags are marked up in. Of the format language_TERRITORY.


 * If your object is part of a larger web site, the name which should be displayed for the overall site. e.g., "IMDb".
 * 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"
 * Writers of the article.
 * Writers of the article.


 * Translates into
 * Translates into


 * A high-level section name. E.g. Technology
 * A high-level section name. E.g. Technology


 * When the article was first published. ISO 8601 Format.
 * When the article was first published. ISO 8601 Format.


 * tags related to Twitter Cards (see OpenGraph Tags)
 * If you did not set a global site name through, you can set a site handle per page. If a global site handle is set this key will be ignored.
 * If you did not set a global site name through, you can set a site handle per page. If a global site handle is set this key will be ignored.

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...

Usage in lua modules
WIP -- 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  or.

Hreflang Attributes
Will generate the following ` ` elements:   

Configuration
The following variables are in use by this extension.

Set 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.

Usage:.

Setting this variable will add a  tag to every page.

Usage:. See for more information.

Setting this variable will add a  tag to every page.

Usage:. See for more information.

Setting this variable will add a  tag to every page.

Usage:.

Setting this variable will add a  tag to every page.

Usage:.

Setting this variable will add a  tag to every page.

Usage:. See for more information.

Setting this variable will add a  tag to every page.

Usage:. See for more information.

Setting this variable will add a  tag to every page.

Usage:. See for more information.

Setting this variable will add a  tag to every page.

Usage:. See for more information.

Only used when Twitter generator is loaded.

Setting this variable will add a  tag to every page.

Usage:.

Array containing the metadata generator names to load.

Default:.

If you only want to change the page title and add 'description', 'keywords', 'robots' tags set

Default image. Local image, if not set $wgLogo will be used.

Disable setting $wgLogo as a fallback image if no image for a page was set.

Defaults to `summary_large_image` for the twitter card type.

Usage: $wgTwitterCardType = 'summary';

An array of page titles where a 'noindex' robot tag should be added. Usage: $wgWikiSeoNoindexPageTitles = [ 'Custom_Title', 'Main_Page' ];

A default language code with area to generate a `` for.

Usage: $wgWikiSeoDefaultLanguage = 'de-de';

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

 * metakeywords / metak
 * use keywords instead


 * metadescription / metad
 * use description instead


 * titlemode / title mode
 * use title_mode instead

Changed argument names

 * article:author -> author
 * article:section -> section
 * article:tag -> keywords
 * article:published_time -> published_time
 * og:image / twitter:image:src -> image
 * og:image:width -> image_width
 * og:image:height -> image_height
 * og:locale -> locale
 * og:site_name -> site_name
 * og:title -> title
 * og:type -> type
 * twitter:description -> description

Known Issues
Extension:PageImages will add an  tag if an image is found on the page. This overwrites any  tag set using this extension.

There is currently no way to disable PageImages setting the meta tag.

schema.org
The  generator will set a SearchAction property based on Special:Search.

The properties publisher and author will be set to  with the name set to the content of.

will be automatically set by fetching the latest revision timestamp. If no  is set,   will be set to the latest revision timestamp.

OpenGraph
will be automatically set by fetching the latest revision timestamp. If no  is set,   will be set to the latest revision timestamp.

Integration
WikiSEO will use descriptions provided by Extension:Description2.