Is a powerful tool for managing and generating sitemaps that is designed to work with Kirby 3. This plugin provides a straightforward approach for creating XML Sitemaps, especially for sites with multiple languages. The multilingual support allows you to create separate URLs for each language, increasing the SEO performance of your website. The plugin creates one XML file with URLs to your website pages and images, automagically โจ assigning their priority and last modification date which can be later easily readed by search engines.
If the website has only one language, a sitemap is generated in /sitemap.xml
.
With this new version (0.2.0), if the site has two or more languages, a <sitemapindex>
is generated in sitemap.xml
and all sub-sitemaps for each language with the following scheme: sitemap_en.xml
, sitemap_es.xml
, etc
Download and copy this repository to /site/plugins/xmlsitemap
git submodule add https://github.com/isaactopo/xmlsitemap.git site/plugins/xmlsitemap
composer require isaactopo/xmlsitemap
The plugin works from the start, outputting all the listed pages from your website on yoursite/sitemap.xml
and redirecting yoursite/sitemap
to yoursite/sitemap.xml
The plugin has 3 config options that you can tweak from your site/config.php
file:
By default not listed pages are Ignored, but sometimes you will want to ignore specific pages. You are able to do it with:
'isaactopo.xmlsitemap.ignore' => ['error', 'legal'],
You can inlude images with:
'isaactopo.xmlsitemap.includeImages' => true,
If you have some factory-generated pages from your Routes or another page that you want to force-include you can do it with:
'isaactopo.xmlsitemap.addCollection' => function () {
$professionals = kirby()->users()->filterBy('publish', true);
$profiles = [];
foreach($professionals as $professional){
$profiles[] = Page::factory([
'slug' => 'team/'.$professional,
'template' => 'profile',
'content' => [
'author' => $professional,
]
]);
}
return $profiles;
},
The plugin generates an automatic priority according to the depth of each page (Thanks Bastian). But you may want to change the priority of some pages by hand. If so, you can do it by creating a new field in the blueprint of the page you want to include:
sitemapPriority:
label: Sitemap Priority
type: number
width: 1/2
max: 1
min: 0
step: 0.1
This way the plugin will prioritise the input from the Panel.
- Isaac Bordons https://topo.bz โ https://morethanlaw.es
- Thanks to Bastian Allgeier for his article on the Cookbook and Pedro Borges for his K2 XML Sitemap plugin