Thread tagged as: Docs

Perch CMS documentation - Create a Google Sitemap

I followed the guide in the documentation to create a sitemap:

It (sitemap.php) created a sitemap containing over 1,000 entries all for the root of the domain!

The documentation says to create sitemap.html as follows:

<perch:before><?xml version="1.0" encoding="UTF-8"?>
    <urlset xmlns="">
        <loc><perch:pages id="pagePath"></loc>

<perch:pages id="pagePath"> didn't return anything, meaning all entries were <loc></loc>.

My eye spotted that there was no '/' at the end (before the '>'), so I changed it to <perch:pages id="pagePath" /> and hey presto the sitemap works as it should.

Dave Lindsay

Dave Lindsay 0 points

  • 2 years ago
Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Hello Dave,

This is because you are using an older version of Perch. Tags in older versions required Perch tags to be self-closing />. Since Perch 3.1, this is no longer required.

The change is documented here:

It was also discussed in Perch's blog if you're interested in learning more:

Thanks for replying Hussein. I will have a look at those links.