PHPackages                             dandjo/sitemap-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. dandjo/sitemap-generator

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

dandjo/sitemap-generator
========================

Memory friendly PHP sitemap generator.

1.0.4(6y ago)0521↓100%MITPHPPHP &gt;=7.0.0

Since Mar 19Pushed 6y agoCompare

[ Source](https://github.com/dandjo/sitemap-generator)[ Packagist](https://packagist.org/packages/dandjo/sitemap-generator)[ RSS](/packages/dandjo-sitemap-generator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

Sitemap Generator
=================

[](#sitemap-generator)

Memory friendly sitemap generator.

Installation
------------

[](#installation)

```
composer require dandjo/sitemap-generator

```

Usage
-----

[](#usage)

```
use Dandjo\SitemapGenerator\Components\Index;
use Dandjo\SitemapGenerator\Components\Url;
use Dandjo\SitemapGenerator\FileWriter;
use League\Flysystem\Adapter\Local;
use League\Flysystem\Filesystem;

$writer = new FileWriter(new Filesystem(new Local('/tmp/')));
$writer->filename = 'sitemap.xml';  // optional
$writer->filenameIndex = 'sitemap.index.xml';  // optional
$writer->indexSize = 50000;  // optional
$writer->urlSetSize = 5000;  // optional
$writer->gzipLevel = 0;  // optional
for ($i = 0; $i < 6000000; $i++) {
    $url = new Url('http://localhost/foo/bar/' . $i);
    $url->changeFrequency = 'always';  // optional
    $url->lastModified = date_create();  // optional
    $url->priority = '0.5';  // optional
    $writer->write($url);
}
$writer->writeIndex(new Index('http://localhost/sitemap/'));
```

If you're using gzip compression, consider using the appropriate extension for the filenames, although it is not mandatory.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~14 days

Total

5

Last Release

2550d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9775283af17974a5fff5640197e99cfdbd3be38dd0ff39ba65c21354ed371c09?d=identicon)[dandjo](/maintainers/dandjo)

---

Tags

phpgeneratorPSR-4SitemapPSR-2PSR-1

### Embed Badge

![Health badge](/badges/dandjo-sitemap-generator/health.svg)

```
[![Health](https://phpackages.com/badges/dandjo-sitemap-generator/health.svg)](https://phpackages.com/packages/dandjo-sitemap-generator)
```

###  Alternatives

[icamys/php-sitemap-generator

Simple PHP sitemap generator.

175342.8k6](/packages/icamys-php-sitemap-generator)[genert/bbcode

BBCode parser from or to HTML.

81324.0k1](/packages/genert-bbcode)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
