In built sitemap generator for a CMS I'm building

Evening all,

I am building a CMS and I’m coming to the end now, and thinking of little extras to offer.

One extra I’m thinking of is for the client to be able to log into their admin account, and perhaps click a link that will take them to a php page that will generate a sitemap.xml file and place it on the root level, and maybe ping google and all.

I have looked in Google and in honesty i have tried 5 and everyone just doesnt do the job or is full of bugs, so as usual I’m coming here to turn to the experts for advice.

Any links or code on offer will be great.


Morning all after the weekend, wondering if you wouldnt mind me bumping this up just in case somebody missed it.


Well, with around 140 views as of me replying, I’d guess many are thinking on the same lines as me, the first time round I saw your post :wink:

“which ‘5 on google’ did he try?”
“’ … just doesnt do the job’ I wonder what that means? Is there such a thing as a sitemap maker which would even fit a custom CMS?”
“I wonder how he stores ‘web pages’ which are supposed to create the sitemap – are they on the file system, in the db, or a bit of both?”
“If s/he can make an entire CMS, then why can’t s/he derive a list of urls into a single file and save it into the top level directory?”
“Is this CMS a custom job, or does it extend something we’ve heard of? Does it even use a known framework?”

Good points Cups

but I have some advise…

in my cms I have an image in footer - it calls a local php file, that eventually serves a blind gif.
before that, it puts the ref in a DB table and counts views for that page…
that way, I can even implement googles “priority” field with real user intrest.

And the good point - the site admin does not have to push a button!

if you flush that table reguarly (cron), it will always be quite up to date
each time google collects my XML, the script reads that table and delivers a fresh xml, ordered by the views…
the priority is 1 for top pages and 0.1 for lower traffic pages…
If you want to push the often missed contents, simply reverse the order…

btw - I have a more rudimentary version of this online as a web service somewhere - but I dont know if Im allowed to post the link here…