This page is a translated version of the page Extension:AutoSitemap and the translation is 33% complete.
Manual de extensões do MediaWiki
Estado da versão: estável
Implementação MyWiki , Ações de página
Descrição Cria e atualiza o arquivo do site do mapa automaticamente quando qualquer página é atualizada.
Autor(es) Dolfinus, François Boutines-Vignard, Jehy, Thomas
Última versão 1.8.0 (1.3 for MW 1.33 and lower) (2023-02-17)
MediaWiki 1.25+
Modifica o banco
de dados
Licença GNU GPL (Licença Pública Geral) 3.0 ou superior
Exemplo Generated sitemap

The AutoSitemap extension automatically builds a "sitemap.xml" file at every page create/edit/delete event. Sitemap file helps search engines to observe your site’s pages. This extension is based on the extension ManualSitemap .


I do not have the possibility to update my sitemap via scheduler (like cron) because of the hosting provider, and I also do not want to update it manually.

So I edited an existing extension to update the sitemap by itself at any page edit, create, delete, rename, upload, etc events.


This extension can be used on small MediaWiki instances (up to 10k pages). If your instance is larger than 50k pages, you should use GenerateSitemap.php instead because it does support sitemap index file, can create separated files for each namespace, compress sitemap files and also designed to be run on schedule instead of triggering after each page modification.


  • Download e coloque o(s) arquivo(s) num diretório chamado AutoSitemap na sua pasta extensions/.
  • Adicione o seguinte código ao final do seu arquivo LocalSettings.php :
    wfLoadExtension( 'AutoSitemap' );
  • Make any change of any of your wiki pages, e.g. create a page or update an existing one
  • Sitemap file will be generated automatically
  •   Concluído – Navegue à página Special:Version em sua wiki para verificar se a instalação da extensão foi bem sucedida.


There are some optional parameters that change the sitemap generation. You can set them in your LocalSettings.php.

Nome do Arquivo SiteMap

You can set filename of sitemap by setting:

$wgAutoSitemap["filename"] = "sitemap.xml"; //default value

Configurações Básicas de URL

By default all URLs in sitemap use $wgCanonicalServer (or $wgServer, if it doesn’t set) as domain prefix. If you want to set it to another one, you can change it manually by setting:

$wgAutoSitemap["server"] = "https://your-site.com";

Notificar Sistemas de Busca

You can notify web sites you want about the update of sitemap. Just write all notify URLs as array:

$wgAutoSitemap["notify"] = [

Sometimes web hoster does not allow the fopen command to call URLs (allow_url_fopen=false). If you can’t or doesn’t want to use notification, set this to empty array by deleting all lines between brackets (= [];).

Excluir Tipos de Páginas do Site do Mapa

You can exclude namespaces or exact pages from including them to sitemap:

$wgAutoSitemap["exclude_namespaces"] = [
]; //default values

$wgAutoSitemap["exclude_pages"] = ['page title to exclude', 'other one'];

Tempo de atualização

You can manually specify the recommended frequency with which all addresses will be checked by search engine:

$wgAutoSitemap["freq"] = "daily"; //default

Available values are:

adjust - for automatic determination of frequency based on page edits count

Página Prioritária

You can manually specify priority for certain pages or namespaces:

$wgAutoSitemap["priority"] = 0.7;


$wgAutoSitemap["priority"][NS_MAIN] = 1;
$wgAutoSitemap["priority"][NS_CATEGORY] = 0.8;


$wgAutoSitemap["priority"]['Main page'] = 1;
$wgAutoSitemap["priority"]['Other page'] = 0.8;

Rate-limit recreation of the sitemap

For wikis with many pages, generating the sitemap may consume significant resources, so you may not want it to happen too frequently. With this option, you can specify that the sitemap should only be recreated if it's at least a certain number of seconds old.

$wgAutoSitemap["min_age"] = 3600; // 1 hour, default 0 (no rate-limit)



Your MediaWiki folder should be permitted for write operations (chmod +w with chown apache or chown nginx).

Htaccess, Nginx

If you want to see a human-readable sitemap, allow read access for sitemap.xsl file in your site config (.htaccess file or other).

Veja Mais