Jump to main content Jump to doc navigation

pdoSitemap i a snippet that easily creates sitemaps for search engines (sitemap.xml). The snippet understands the parameters used by the snippet GoogleSitemap (by translation to the native parameters) and can therefore easily replace it.

The main feature is a much higher processing speed compared to the snippet GoogleSitemap. The site bezumkin.ru with 1700 pages increased the generation speed of the sitemap by 12 times from 8.4 seconds down to 0.7.

By default is the check for user permissions disabled. This can easily be remedied by including the parameter &checkPermissions (Note: slows down the generation!):


The sitemap generation is more effective if resources are excluded from the output rather than to explicit include resources that shall be visible (see examples below).


pdoSitemap accepts all options for pdoTools. Here are some of them:

Parameter Default value Description
&sitemapSchema http://www.sitemaps.org/schemas/sitemap/0.9 The scheme used for the sitemap.
&forceXML 1 Force output as XML.
&priorityTV An optional field that indicates the priority of the resource. The template variable stated here must also be added to the parameter &includeTVs



@INLINE <url>\n\t


@INLINE <?xml version=\"1.0\" encoding=\"[[++modx_charset]]\"?>\n<urlset xmlns=\"[[+schema]]\">\n[[+output]]\n</urlset>

Priority and Change frequency for the resource is mapped based on the date for the last modification of the document:

Time since the last update of the document Priority Change frequency
Less than a day ago 1.0 daily
Over one day but less than a week ago 0.75 weekly
More than a week ago but less than a month ago 0.5 weekly
More than a month ago 0.25 monthly

Instructions how to create a sitemap.xml resource

  1. Create a new document in the root of the site. On the Document tab, select an empty template. Enter the "Title" of the document (your choice) and set the "Resource Alias" to sitemap. Mark the checkboxes "Hide From Menus" and "Published".
  2. Go to the Settings tab and select XML as the "Content Type".
  3. Remove the mark from the checkbox "Rich Text" and save the document.
  4. The "Content" of the document should only be a call to the snippet pdoSitemap (see the examples here below).


To create a sitemap for the default context, this should be sufficient in the most cases:


Generate sitemap only from certain containers:


The extend the example above to also exclude resources with id = 15 and 25, together with their descendants:


Change the example above to exclude the resource with id = 25 but include its descendants:


Add another context (catalog) to the example above (if web is the default context):


This call forces the http schema of the URL:s to https:


This call shows the execution log (remember to change the content type of the resource to HTML):


Support the team building MODX with a monthly donation.

The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.


  • modmore
  • Jens Wittmann – Gestaltung & Entwicklung
  • Fabian Christen
  • Digital Penguin
  • Dannevang Digital
  • Sepia River Studios
  • Chris Fickling
  • CrewMark
  • deJaya
  • Following Sea
  • Anton Tarasov
  • eydolan
  • Raffy
  • Lefthandmedia
  • Murray Wood
  • Snow Creative
  • Nick Clark
  • Helen
  • JT Skaggs
  • krisznet
  • YJ
  • Yanni
  • Richard


$367 per month—let's make that $500!

Learn more