Sitemap is including URL of pages in preview mode

Permalink 1 user found helpful
Hi, the "Generate Sitemap File" function in the dashboard (/dashboard/system/optimization/jobs/) creates entries in the sitemap file for pages in preview mode. For example:

Is it a bug? Those URL resolves to a 404 error if the user is not logged in.

I want to use a cron to auto-generate the sitemap but I cannot do that until this wrong behavior is fixed.

Any ideas? Thank you.

Update: I removed the pages since they were the default "blog" pages included on a C5 installation. My new (and real) site pages seems to work fine and even if a page is in preview mode, the "preview mode URL" doesn't get included in the sitemap file. So this is resolved for me now. Thank you.

View Replies:
pmlmedia replied on at Permalink Reply
I'm having the same issue - C5 generates a sitemap which includes preview pages.
As I have friendly URLs turned on, I manually delete from my sitemap.xml any URLs that end in ?cID=xxx

It would be good if the C5 Job to generate a sitemap didn't generate URLS from un-approved pages in the sitemap.xml file.

Incidentally, It's not clear how to generate a sitemap from this documentation - I found your post explained this better i.e dashboard/system/optimisation/jobs
roggy replied on at Permalink Reply
I was having a similar issue. I had 7 pages in sitemap.xml with the cID in the url. If I logged in as a admin and looked at those pages/url ware all in "pending approval" state.

I fixed the issue by:
- approving the page
- delete the page
- empty the trash (accessible via full sitemap/show system pages/
- empty the trash
- clear the cache

The root of the problem still exists but at list i got rid of those pages in sitemap.xml.