PHPackages                             cultuurnet/sitemap-xml - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. cultuurnet/sitemap-xml

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

cultuurnet/sitemap-xml
======================

Library for writing sitemap XML.

v1.0.2(9y ago)27.6k11Apache-2.0PHPPHP &gt;=5.3CI failing

Since May 19Pushed 6y ago26 watchersCompare

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

READMEChangelog (4)Dependencies (4)Versions (5)Used By (1)

sitemap-xml-php
===============

[](#sitemap-xml-php)

PHP library for writing sitemap XML conform with the [sitemaps.org schema](http://www.sitemaps.org/protocol.html).

Usage
=====

[](#usage)

Note that the SiteMapXmlWriter classes will always write a new sitemap. It's not possible to edit or delete entries from an existing sitemap.

Urlset
------

[](#urlset)

**Example**

```
// Create a new urlset writer.
$writer = new SiteMapUrlSetXmlWriter();
$writer->open('your/path/to/file.xml');

// Create a new entry object.
$entryLocation = Url::fromNative('http://foo.bar/file.html');
$entryModified = Date::fromNative(2015-05-19);

$entry = new SiteMapXmlEntry($entryLocation);
$entry->setLastModified($entryModified);

// Write the entry object.
$writer->write($entry);

// Close the writer. (Will save the XML.)
$writer->close();

```

**Result**

```

  http://foo.bar/file.html
  2015-5-19

```

Sitemap index
-------------

[](#sitemap-index)

[http://www.sitemaps.org/protocol.html#sitemapIndex\_sitemap](http://www.sitemaps.org/protocol.html#sitemapIndex_sitemap)

**Example**

```
// Create a new sitemap index writer.
$writer = new SiteMapIndexXmlWriter();
$writer->open('your/path/to/file.xml');

// Create a new entry object.
$entryLocation = Url::fromNative('http://foo.bar/sitemap-file.xml');
$entryModified = Date::fromNative(2015-05-19);

$entry = new SiteMapXmlEntry($entryLocation);
$entry->setLastModified($entryModified);

// Write the entry object.
$writer->write($entry);

// Close the writer. (Will save the XML.)
$writer->close();

```

**Result**

```

  http://foo.bar/sitemap-file.xml
  2015-5-19

```

Writing XML to output / memory
------------------------------

[](#writing-xml-to-output--memory)

Passing `null`, or `php://output` to the `open()` method of any `SiteMapXmlWriter` object will write the XML to the output stream.

Passing `php://memory` will write the XML to the memory stream.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 86.7% of commits — single point of failure

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 ~235 days

Total

4

Last Release

3312d ago

Major Versions

v0.1-alpha → v1.02015-05-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/d36d172d00ced6637c459c23a28191f50ed5e6bbe46ec97e07b78f166fbdff18?d=identicon)[dev-publiq](/maintainers/dev-publiq)

![](https://www.gravatar.com/avatar/df052a58ecfa5a07fd2b4cb12bb128ab28ff4b8e82fb0831eab81623b898ddb4?d=identicon)[madewithlove-machine-user](/maintainers/madewithlove-machine-user)

---

Top Contributors

[![bertramakers](https://avatars.githubusercontent.com/u/959026?v=4)](https://github.com/bertramakers "bertramakers (13 commits)")[![alduya](https://avatars.githubusercontent.com/u/255367?v=4)](https://github.com/alduya "alduya (1 commits)")[![JonasVHG](https://avatars.githubusercontent.com/u/4658984?v=4)](https://github.com/JonasVHG "JonasVHG (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/cultuurnet-sitemap-xml/health.svg)

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

###  Alternatives

[friends-of-hyva/purchase-order-number

Hyvä Themes Checkout Module - addon Purchase Order Number

1015.1k](/packages/friends-of-hyva-purchase-order-number)

PHPackages © 2026

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