Jump to content

Handbuch:Sitemap

From mediawiki.org
This page is a translated version of the page Manual:Sitemap and the translation is 25% complete.
Outdated translations are marked like this.

Sitemaps sind Dateien, die es Suchmaschinenrobotern (wie googlebot) effizienter machen, eine Website zu crawlen (sofern der Bot das Sitemap-Protokoll unterstützt).

MediaWiki supports at least three methods of generating sitemap files.

  • REST API
  • generateSitemap.php maintenance script
  • Sitemap extensions

REST API

Starting with version 1.45, MediaWiki provides a REST API to generate a sitemap on demand.

Enabling REST API Sitemaps

Add the following line to LocalSettings.php to enable the Rest sitemap:

$wgSitemapApiConfig['enabled'] = true;

Add to robots.txt

Sitemap https://example.com/w/rest.php/site/v1/sitemap/0

Note that the REST API can draw the attention of bots, degrading site performance. The WMF has restricted access to the sitemap on all of its projects.

generateSitemap.php

If you choose not use the new REST API, then generateSitemap.php can be used as a maintenance script to generate sitemap files.

Add to robots.txt

Sitemap https://example.com/sitemap/NameOfSitemapIndexFile

Sitemap extensions

In der Vergangenheit wurden Sitemap-Erweiterungen verwendet, um diese zu generieren.