From MediaWiki.org
Jump to: navigation, search

Note: Since MediaWiki 1.6, the MediaWiki core has a Google site map generator which may be more appropriate than this extension. It is a command-line utility, and it is located at maintenance/generateSitemap.php in your MediaWiki directory. The command line is "php generateSitemap.php sitename" and is run from the maintenance directory at the server's command line interface. See Manual:generateSitemap.php for more information.

You should use this extension ONLY if you can't use original utility because of safe mode or some kind of another security settings.

MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png

Release status:Extension status stable

ImplementationTemplate:Extension#type Special page
DescriptionTemplate:Extension#description Adds a special page to create Sitemaps.
Author(s)Template:Extension#username François Boutines-Vignard, Jehy, Thomas (Jehytalk)
Latest versionTemplate:Extension#version 1.2 (2012-09-20)
MediaWikiTemplate:Extension#mediawiki 1.19.1+
Database changesTemplate:Extension#needs-updatephp No
LicenseTemplate:Extension#license GNU General Public License 2.0 or later
ExampleTemplate:Extension#example Generated sitemap

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

Check usage and version matrix.


This extension is a fixed version of abandoned extension Extension:Google Sitemap. Since it is not fixed for already 2 years, I took responsibility, fixed all known bugs and published it here. Also, I am going to fix and complete it in future. Many people, including me, can't use the maintenance scripts...

Please, credit Francois Boutines for original script.

If you have any questions - please see discussion page or take a look at original extension.


ManualSitemap is a small, non-intrusive sitemap generator.

ManualSitemap Extension creates a Special:ManualSitemap page which allows you to automatically create and update a sitemap for your Mediawiki site. This allows Google and other search engines to explore your Mediawiki site smarter and faster.

The Special:ManualSitemap page is designed for bureaucrats/administrators. It saves a XML Sitemap file called sitemap.xml (at the root of the wiki by default) and prints some reporting.

The XML file has the following properties:

  • it is sorted by decreasing article popularity (ie. highest number of hits).
  • it contains articles only : no redirection pages, nor any other special/external page. However, you can configure it.

In order to produce more relevant Sitemaps, ManualSitemap Extension can also estimate the revision frequency of your pages and associate them a priority according various schemes.


  1. Extract the archive into /extensions directory
  2. Add the following lines near the end in the LocalSettings.php file:

Configuration options[edit]

There are various options for extension, you can put them into your LocalSettings.php file (before the "require once") line. However, extension should work even out-of box.

Search engines notification[edit]

If servers that fetch the sitemap could not be notified automatically, the warning will be shown. Sometimes web hoster does not allow the fopen command to call urls (allow_url_fopen=false). Also a link where the user can manually inform the server like google will be shown.

# Notify all web sites you want about the update of sitemap
$ManualSitemap_Notify[] = 'http://www.google.com/webmasters/sitemaps/ping?sitemap='.$sitemap;
$ManualSitemap_Notify[] = 'http://search.yahooapis.com/SiteExplorerService/V1/ping?sitemap='.$sitemap;
$ManualSitemap_Notify[] = 'http://webmaster.live.com/ping.aspx?sitemap='.$sitemap;
$ManualSitemap_Notify[] = 'http://api.moreover.com/ping?u='.$sitemap;
$ManualSitemap_Notify[] = 'http://submissions.ask.com/ping?sitemap='.$sitemap;

Exclude types of pages from sitemap[edit]

# Exclude pages from sitemap (value "1" means "exclude"):

#Please refer to
#for more detailed explanation
	NS_MAIN =>           '0',	NS_TALK =>           '1',
	NS_USER =>           '1',	NS_USER_TALK =>      '1',
	NS_PROJECT =>	     '0',	NS_PROJECT_TALK =>   '1',
	NS_IMAGE =>          '0',	NS_IMAGE_TALK =>     '1',
	NS_MEDIAWIKI =>      '1',	NS_MEDIAWIKI_TALK => '1',
	NS_TEMPLATE =>       '1',	NS_TEMPLATE_TALK =>  '1',
	NS_HELP =>           '1',	NS_HELP_TALK =>      '1',
	NS_CATEGORY =>       '1',	NS_CATEGORY_TALK =>  '1'

Setting base url other then $wgServer[edit]

$ManualSitemap_ServerBase = "http://your-base-url.com";
#With that all sitemap entries get this as their base url. If not set $wgServer is used

Exclude pages from sitemap by name[edit]

$ManualSitemap_ExcludeSites[] = 'page title to exclude';
$ManualSitemap_ExcludeSites = array('page1 title to exclude', 'page2 title to exclude');
#to exclude some pages from the sitemap. The pages exclude name must be equal to the name/title shown at the Special:ManualSitemap site.


Set permissions[edit]

You must create the file sitemap.xml in your wiki root directory, and chmod it (change permissions) to 777 before running Special:ManualSitemap.[1]

First step[edit]

Visit the new Special:ManualSitemap page and click "update sitemap" button. Then you will be granted a link, put it to your robots.txt (write from new line "Sitemap: " and the link) and Give Google this link.

Updating sitemap[edit]

The Special:ManualSitemap page will build a Sitemap out of the all articles (by accepting the wpPriorityType[2] parameter).

To update the Sitemap, simply visit Special:ManualSitemap as a bureaucrat and click "Update sitemap" button.


  • ManualSitemap Extension works with both MySQL and INNODB installations.
  1. Instructions on how to change permissions for CuteFTP, Voyager FTP, Leech FTP, Total Commander (Windows Commander), WS FTP. Using My network places, right click Sitemap.xml, then left click "Properties". Then check all 9 boxes, then click "Okay".
  2. Google complains if priority is constant.

See also[edit]