Sample Code

Generate Sitemap for Google and other Search Engines using PHP

Google has a Sitemap generator written using Python. Python is a great language, but I prefer PHP. I took the basic idea of the Sitemap generator and converted it into a solution more suitable for my application needs. If you are looking for a way to easily create a Sitemap for submitting to Google and other search engines, you have come to the right place. I call this one cron_gen_sm.php.

You can download cron_gen_sm.php here. Also, you can view partial code below.

You can upload cron_gen_sm.php to your current cron job script folder or anywhere else on your server. I prefer to send the Sitemap to Google once a week because I am not updating the links very often.

If you have questions or comments about this script, please use the live chat feature on the website here or send an email to the address on the contact page. This is not the only way to generate a Sitemap for Google, but it works well. Feel free to recommend revisions.