PHP Sitemap Generator in english

PHP class which generates sitemaps compatible with protocol Sitemap 0.90. Class aims to cover specification in 100% and be as simple as possible. Usage examples can be found on phpclasses.org.

Class features:

  • Full compatibility with UTF-8
  • Support for Sitemap index
  • Handling up to 50,000,000 URLs
  • Support for robots.txt files
  • Automatic notification for Google, Yahoo!, Ask and Bling search engines.
  • Support for Yahoo App ID
  • Support for GZip

Link to code on PHPClasses: Sitemap Generator

Fork me on GitHub
  1. 9 lutego 2010, 19:30 | #1

    Great class! I found that in phpclasses.org.

    I have a question: when the 50000 limit is touched, automaticaly the script generates „sitemap2.xml” (and so on) & updates the sitemap-index.xml?

    Thank you!

  2. 9 lutego 2010, 19:38 | #2

    Yes, exactly. It will generate successive sitemap files and put it all together to sitemap-index. You can test it by changing

    $maxURLsPerSitemap

    to small value. Advanced example shows it.

  3. 11 lutego 2010, 20:57 | #3

    Oh, great! Very thank you for the answer! :-D

  4. 19 marca 2010, 15:09 | #4

    sorry, but i am unable to run your class

  5. 22 marca 2010, 10:07 | #5

    Hello.
    Please give us more details.
    Code examples or some error message.
    Thanks.

  6. Julien
    23 września 2010, 12:02 | #6

    Hello,

    Your class is very good, but i have a question :

    How we do to generate sitemaps when we have several millions of urls ? Without exhausted the allowed memory.

    Regards.

  7. 23 września 2010, 12:11 | #7

    Hi.
    Did you do some tests?
    To be honest, i don’t have idea how class will act in case of millions records.

  8. Julien
    23 września 2010, 13:16 | #8

    Yes i did some tests this morning, with around 500,000 urls, and i’ve got a fatal error for the allowed memory.
    I will try this afternoon to do a system to write urls in file by parts, this will take less memory.

  9. 15 grudnia 2010, 17:22 | #9

    Hello, are you planning to create a Sitemap Qenerator for mobile sitemaps?

    See here: http://www.google.com/support/webmasters/bin/topic.py?hl=en&topic=8493

    Thank you
    Andrea

  10. michele
    18 grudnia 2010, 11:31 | #10

    Hi, I tried this class and it failed after 60000 url generated for allowed memory.
    I think it should write to file during the addurl method.
    If are planning to modify it let me know.
    I found also another bug in the robots function where sitemap filename is written like *.gz.gz
    However this functionalities where exactly what i was looking for.
    thanks.

  1. Brak jeszcze trackbacków