PHPackages                             artemperepechai/sitemap - 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. artemperepechai/sitemap

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

artemperepechai/sitemap
=======================

Sitemap and sitemap index builder

2.0.6(9y ago)034BSD-3-ClausePHPPHP &gt;=5.3.0

Since Jun 29Pushed 9y agoCompare

[ Source](https://github.com/artemPerepechai/sitemap)[ Packagist](https://packagist.org/packages/artemperepechai/sitemap)[ Docs](https://github.com/samdark/sitemap)[ RSS](/packages/artemperepechai-sitemap/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (10)Used By (0)

Sitemap
=======

[](#sitemap)

Sitemap and sitemap index builder.

[![](https://camo.githubusercontent.com/d34b2f09bcd615ca3d858f9562cffa213f1496eb1eb809a038932f76eed78556/68747470733a2f2f7472617669732d63692e6f72672f73616d6461726b2f736974656d61702e737667)](https://camo.githubusercontent.com/d34b2f09bcd615ca3d858f9562cffa213f1496eb1eb809a038932f76eed78556/68747470733a2f2f7472617669732d63692e6f72672f73616d6461726b2f736974656d61702e737667)

Features
--------

[](#features)

- Create sitemap files.
- Create sitemap index files.
- Automatically creates new file if 50000 URLs limit is reached.
- Memory efficient buffer of configurable size.

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

[](#installation)

in composer.json

"require": { "artemPerepechai/sitemap" : "dev-master" }, "repositories": \[ { "url": "", "type": "vcs" } \],

After that, make sure your application autoloads Composer classes by including `vendor/autoload.php`.

How to use it
-------------

[](#how-to-use-it)

```
use samdark\sitemap\Sitemap;
use samdark\sitemap\Index;

// create sitemap
$sitemap = new Sitemap(__DIR__ . '/sitemap.xml');

// add some URLs
$sitemap->setLocation('http://example.com/mylink4')
        ->setLastModified(time())
        ->setFrequency(Sitemap::DAILY)
        ->setAlternateLanguage('en', 'http://example.com/en')
        ->setAlternateLanguage('de', 'http://example.com/de')
        ->setAlternateLanguage('fr', 'http://example.com/fr')
        ->setPriority(0.1)
        ->addItem();

// write it
$sitemap->write();

// get URLs of sitemaps written
$sitemapFileUrls = $sitemap->getSitemapUrls('http://example.com/');

// create sitemap for static files
$staticSitemap = new Sitemap(__DIR__ . '/sitemap_static.xml');

// add some URLs
$staticSitemap->setLocation('http://example.com/about')
              ->setLastModified(time())
              ->addItem();

$staticSitemap->setLocation('http://example.com/tos')
              ->setLastModified(time())
              ->addItem();

$staticSitemap->setLocation('http://example.com/jobs')
              ->setLastModified(time())
              ->addItem();

// write it
$staticSitemap->write();

// get URLs of sitemaps written
$staticSitemapUrls = $staticSitemap->getSitemapUrls('http://example.com/');

// create sitemap index file
$index = new Index(__DIR__ . '/sitemap_index.xml');

// add URLs
foreach ($sitemapFileUrls as $sitemapUrl) {
    $index->addSitemap($sitemapUrl);
}

// add more URLs
foreach ($staticSitemapUrls as $sitemapUrl) {
    $index->addSitemap($sitemapUrl);
}

// write it
$index->write();
```

Options
-------

[](#options)

There are two methods to configre `Sitemap` instance:

- `setMaxUrls($number)`. Sets maximum number of URLs to write in a single file. Default is 50000 which is the limit according to specification and most of existing implementations.
- `setBufferSize($number)`. Sets number of URLs to be kept in memory before writing it to file. Default is 1000. If you have more memory consider increasing it. If 1000 URLs doesn't fit, decrease it.
- `setUseIndent($bool)`. Sets if XML should be indented. Default is true.

Running tests
-------------

[](#running-tests)

In order to run tests perform the following commands:

```
composer install
phpunit

```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 51.2% 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 ~65 days

Recently: every ~111 days

Total

8

Last Release

3556d ago

Major Versions

1.0.0 → 2.0.02015-07-03

PHP version history (2 changes)1.0.0PHP &gt;=5.4.0

2.0.4PHP &gt;=5.3.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23028789?v=4)[artemPerepechai](/maintainers/artemPerepechai)[@artemPerepechai](https://github.com/artemPerepechai)

---

Top Contributors

[![samdark](https://avatars.githubusercontent.com/u/47294?v=4)](https://github.com/samdark "samdark (22 commits)")[![artemPerepechai](https://avatars.githubusercontent.com/u/23028789?v=4)](https://github.com/artemPerepechai "artemPerepechai (13 commits)")[![WinterSilence](https://avatars.githubusercontent.com/u/3521094?v=4)](https://github.com/WinterSilence "WinterSilence (3 commits)")[![atailouloute](https://avatars.githubusercontent.com/u/11352491?v=4)](https://github.com/atailouloute "atailouloute (2 commits)")[![fr05t1k](https://avatars.githubusercontent.com/u/2131624?v=4)](https://github.com/fr05t1k "fr05t1k (1 commits)")[![wawan93](https://avatars.githubusercontent.com/u/1741716?v=4)](https://github.com/wawan93 "wawan93 (1 commits)")[![zinovyev](https://avatars.githubusercontent.com/u/1627048?v=4)](https://github.com/zinovyev "zinovyev (1 commits)")

---

Tags

Sitemap

### Embed Badge

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

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

###  Alternatives

[samdark/sitemap

Sitemap and sitemap index builder

5401.4M43](/packages/samdark-sitemap)[tackk/cartographer

A PHP sitemap generation tool.

325492.4k3](/packages/tackk-cartographer)[nystudio107/craft-seomatic

SEOmatic facilitates modern SEO best practices &amp; implementation for Craft CMS 5. It is a turnkey SEO system that is comprehensive, powerful, and flexible.

1741.5M52](/packages/nystudio107-craft-seomatic)[novactive/ezseobundle

Novactive eZ SEO Bundle is an Ibexa Platform bundle for SEO simplications. metas, sitemaps, robots.txt, etc.

26256.6k3](/packages/novactive-ezseobundle)[rainlab/sitemap-plugin

Sitemap plugin for October CMS

2280.9k1](/packages/rainlab-sitemap-plugin)[fof/sitemap

Generate a sitemap

1796.4k2](/packages/fof-sitemap)

PHPackages © 2026

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