PHP Classes

PHP Crawl Sitemap Generator: Crawl Web site and generate a XML sitemap

Recommend this page to a friend!
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 505 All time: 5,790 This week: 82Up
Version License PHP version Categories
crawl-sitemap 1.0.0GNU General Publi...5XML, PHP 5, Searching, SEO


This class can crawl Web site and generate a XML sitemap.

It crawls a given site retrieving the Web pages, parsing the HTML to extract the links to other pages.

The class parses the linked pages recursively until all links have been followed.

It can exclude a given list of directories so any contained URLs will not be crawled.

It generates a XML sitemap from the list of crawled pages and stores it in the sitemap.xml file.

Picture of Gianluca Zanferrari
  Performance   Level  
Name: Gianluca Zanferrari <contact>
Classes: 19 packages by
Country: The Netherlands The Netherlands
Age: 57
All time rank: 1674 in The Netherlands The Netherlands
Week rank: 225 Down5 in The Netherlands The Netherlands Down
Innovation award
Innovation award
Nominee: 5x



// replace the example URL with a real one
$targetUrl = '';
$arrExcludeFolders = array(''); // empty array for no folder excluding

$sm = new sitemap($targetUrl, $arrExcludeFolders);


// see class for more options

// leave second parameter for no output to browser
$sm->write_xml('sitemap.xml', TRUE);

  Files folder image Files  
File Role Description
Plain text file simple_html_dom.php Class html dom class
Plain text file sitemap.class.php Class class itself
Accessible without login Plain text file sitemap.example.php Example example script

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:5,790
This week:82Up