Creating XML Sitemap Files

Posted 19 Dec 2006 in Blog, Programming

Today I build one PHP script to create sitemap files for websites on my office. This is not so great script, but help me much to finish the tasks :)

With this script, I do not need to enter the URLs of the website manually, that is contain thousand of URLs. The script will scanning for all files on the website, and then write it on XML file, that suitable with protocol.

If number of URLs reach the limit (50.000 URLs), it will automatically split to another sitemap file.

If you want to try the script, just download it here. You need to configure it first, to be suitable with your server.

After the files are created, you may try to validate it. I use this tool:

Remember, you have to specify the schema used for the validator.

Or, the easier way is validating by this software: XMLBlueprint

The tool is not free, it is 10 days trial. But you need it for hours only :)

If validated, you may submit the sitemap index file to search engine, like Yahoo:

Happy submitting :)




  2. for validating XML why don’t you use xml class ( i’ve used it for my final test… it’s very2 useful *pake logat india*

  3. #Isdah:
    It’s not only validating for XML format, but also validate it against Sitemap’s XML scheme.

  4. kok cuman statik? kalau generating dynamic?

  5. #Ferdhie:
    File yang dihasilkan itu akan disubmit ke search engine, tentu harus statis, didownload dulu baru disubmit.

    Kalau mau mengupdate, ya generate ulang :)

  6. If You have any problems whit creating the sitemaps, try Sitemap Writer. It is a simple tool that helps you to create and keep up-to-date sitemaps for your websites.
    Or the Sitemap Writer Pro. It is a new (professional) edition of a SitemapWriter., with a crawler, search engine notification tool and Yahoo Index viewer. :)

  7. You can also check our sitemap generator. It can scan large websites, and besides creating HTML, Text, XML sitemaps etc. it can ping and upload sitemaps, calculate priority values (based on internal website linking), create robots.txt, show broken links etc.


Your Comment to aryo