Skip to content
This repository has been archived by the owner. It is now read-only.
Easy PHP Sitemap Generator
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

PHP Sitemap generator for websites

Author - Denis Mitrofanov

Version 1.0.0


This program crwawls the entire website storing links, priorities and update periods.

$sitemap = new Sitemap('');
    ->setExcluded(['', '', ''])
    ->setLevel(0, 1, 'daily')
    ->setLevel(1, 0.80, 'weekly')
    ->setLevel(2, 0.64, 'weekly')
    ->setLevel(3, 0.64, 'monthly')

    $links = $sitemap->generate();

First you set the website you want to parse, than set the routes you want to exclude. Levels are set from 0 as domain root, to the third level, everything else should be set as minimalPriority (default is 0.64). Default update period is set to 'monthly'.

When you run $sitemap->generate() it return a LinksCollection object. Than you can persist it to actual sitemap.xml file. By runnig $links->toXmlFile('sitemap.xml') of course you can specify full path, and not just the file name.

The output will contain xml with line for every detected link like following:


Resources that use this generator are:

You can’t perform that action at this time.