Your sitemap might be lying to you
A static sitemap.xml wins over any dynamic route, and a generator that walks the filesystem cannot see content stored in a database.
Two failure modes, both of which leave you with a sitemap that looks fine, validates fine, and quietly omits most of your site.
One: the static file wins
If you generate /sitemap.xml in your application router, but a real sitemap.xml also exists in the document root, the file wins. It is right there in the config:
location / {
try_files $uri $uri/ /index.php?$query_string;
}
# ^^^^ the file is served before PHP ever runsSo your careful dynamic sitemap is dead code, and visitors get whatever stale file was written months ago. The symptom is a sitemap with a handful of URLs and a lastmod from a date you do not recognise.
Check which one you are actually serving before you debug the generator:
$ ls -la /var/www/site/sitemap.xml
-rw-r--r-- 1 www-data www-data 243 Jul 14 18:50 sitemap.xml # this is what people getTwo: the generator cannot see your content
Most sitemap generators walk the document root looking for .html files and directories with an index. That works for a static site and finds nothing at all on a site whose pages live in a database or a JSON store — which is every CMS.
The result is a sitemap containing exactly one URL: /. It is not broken, it is not empty, it will not error. It is simply blind to the thing you actually publish.
Making them agree
Pick one source of truth. If you keep the static file — and there are good reasons to, it is cacheable and needs no PHP — then regenerate it whenever content changes, and teach the generator about your content store:
- Walk the filesystem for genuinely static pages, as before.
- Then read your page/post store and add every published entry.
- Skip anything explicitly marked noindex — those are excluded on purpose.
- Rewrite the file on every publish, unpublish and delete, not on a nightly cron.
Verify it the way a crawler would
$ curl -s https://example.com/sitemap.xml | grep -c '<loc>'
47
# and confirm every one of them actually serves
$ curl -s https://example.com/sitemap.xml \
| grep -oP '(?<=<loc>)[^<]+' \
| xargs -I{} -P4 curl -s -o /dev/null -w '%{http_code} {}\n' {} \
| grep -v '^200'That last command should print nothing. If it prints a 404, you are advertising a page you do not serve — which is worse than omitting it, because it costs crawl budget and signals carelessness.
Alien XP
Runs the servers behind AlphaPanel and writes up what breaks.




