Loading...
 
Skip to main content

How to use the sitemap feature

New in Tiki18: A built-in site map XML generator: https://sourceforge.net/p/tikiwiki/code/63719
Revamped in Tiki23 by replacing deprecated sitemap-php by melbahja/seo

Google wrote:
A sitemap is a file where you provide information about the pages, videos, and other files on your site, and the relationships between them. Search engines like Google read this file to crawl your site more efficiently. A sitemap tells Google which pages and files you think are important in your site, and also provides valuable information about these files. For example, when the page was last updated and any alternate language versions of the page.


In tiki, to generate the sitemap of your site, go to control panels / general preferences page / navigation tab. After activation, you can select 'sitemap' in the tools menu or visit: tiki-admin_sitemap.php

Clicking on 'rebuild sitemap' will generate two xml files (sitemap.xml, sitemap-index.xml).


The sitemap-index.xml file will look like this:

Copy to clipboard
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <sitemap> <loc> http://example.org/storage/public/sitemap.xml </loc> <lastmod>2017-09-26</lastmod> </sitemap> </sitemapindex>


You can now submit your sitemap-index.xml to Google. Submitting your new sitemap is free. You must go to https://search.google.com/search-console/about for sending your sitemap.The documentation explaining how to do it can be found here


Launch from the command line

In command line you need to have admin access to the CLI,then go to the root of your application. run :

Replace http://wikisuite.org with your domain name
Copy to clipboard
# php console.php sitemap:generate http://wikisuite.org New sitemap created.


the submission and results will be the same as if you did it with the GUI

The result is here: http://wikisuite.org/storage/public/sitemap.xml


New in Tiki30: Generation Methods and Sitemap Splitting


Starting from Tiki 30, the sitemap feature was significantly revamped (see MR !9573) with two new preferences available under Control Panels / General Preferences / Navigation tab / Sitemap section.

Generation Method (sitemap_method)


The new Generation Method preference controls how sitemap XML files are produced and served.

ValueBehaviour
Automatic (default)Sitemap files are generated on the fly when a search engine (or any client) requests them via tiki-sitemap.php. This is the recommended default for most sites.
ManualSitemap files are pre-built and saved to disk (under storage/public/). Files must be regenerated explicitly by clicking Rebuild Sitemap in tiki-admin_sitemap.php, by running the console command, or by scheduling a scheduler task.


When using Manual mode you can automate regeneration through the Scheduler or via the command line:

Replace https://example.org with your domain name
Copy to clipboard
php console.php sitemap:generate https://example.org


Sitemap Splitting (sitemap_split)


For large sites, a single sitemap file per content type can grow very large. The new Sitemap Splitting preference lets you split sitemap files into smaller chunks based on publication date.

ValueBehaviourExample file names
No split (default)One sitemap file per content type, containing all entries.sitemap-articles.xml, sitemap-pages.xml, sitemap-blogposts.xml
Per YearOne sitemap file per content type per publication year.sitemap-articles-2024.xml, sitemap-blogposts-2023.xml
Per Year–Month (recommended for large sites)One sitemap file per content type per year and month.sitemap-articles-2024_03.xml, sitemap-blogposts-2023_11.xml


The sitemap index file (sitemap-index.xml) is updated automatically to reference all generated sub-sitemaps regardless of the split mode chosen.


Multilingual support


When Multilingual (Multilingual) is enabled on your site, sitemap entries for wiki pages and articles now include hreflang alternate-language links ( <xhtml:link rel="alternate"> ) pointing to each available translation. This helps search engines serve the correct language version to users in different locales.

Example output for a bilingual site:

Copy to clipboard
<?xml version="1.0" encoding="UTF-8"?> <!-- Generated by https://git.io/phpseo --> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"> <url> <loc>https://example.org/HomePage</loc> <priority>1.0</priority> <changefreq>weekly</changefreq> <lastmod>2026-03-29T10:52:38+00:00</lastmod> <xhtml:link rel="alternate" href="https://example.org/Accueil" hreflang="fr"/> </url> </urlset>



Sitemap file URL format


The way sub-sitemap URLs appear inside the index file depends on whether SEF URL are active:

SEF URLs enabledSEF URLs disabled
/sitemap-articles.xml/tiki-sitemap.php?file=sitemap-articles.xml

Summary of new preferences (Tiki 30)

Preference keyTypeDefaultDescription
sitemap_methodList (auto / manual)autoControls whether sitemaps are generated on the fly (auto) or pre-built on demand (manual).
sitemap_splitList (none / year / year_month)noneControls whether sitemap files are split by year or by year and month.



  • See Search engine optimization for existing documentation on all the current SEO facilities and the site map feature in particular.