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="https://www.sitemaps.org/schemas/sitemap/0.9"> </perch:before> <url> <loc>https://example.com<perch:pages id="pagePath"></loc> </url> <perch:after> </urlset> </perch:after>
<perch:pages id="pagePath"> didn't return anything, meaning all entries were <loc>https://example.com</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.