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

ActiveLibrary

bilaleren/sitemap
=================

PHP sitemap.xml generator.

v1.0.1(5y ago)023MITPHPPHP &gt;=7.1CI failing

Since Jul 7Pushed 5y ago1 watchersCompare

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

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

PHP Sitemap Generator
---------------------

[](#php-sitemap-generator)

Sitemaps are an easy way for webmasters to inform search engines about pages on their sites that are available for crawling. In its simplest form, a Sitemap is an XML file that lists URLs for a site along with additional metadata about each URL (when it was last updated, how often it usually changes, and how important it is, relative to other URLs in the site) so that search engines can more intelligently crawl the site.

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

[](#installation)

```
composer require bilaleren/sitemap

```

Create Sitemap
--------------

[](#create-sitemap)

```
header('Content-Type: application/xml; charset=utf-8');

require 'vendor/autoload.php';

use SiteMap\SiteMap;
use SiteMap\Entities\Url;
use SiteMap\Entities\Alternate;

$siteMap = new SiteMap([
    new Url('http://example.com/example-1')
]);

// with alternate
$siteMap
    ->registerBasicUrl('http://exampe.com/path-1')
    ->registerAlternate(new Alternate('http://exampe.com/tr/path-1', 'tr'));

$siteMap->registerBasicUrl('http://exampe.com/path-2');

$siteMap->registerUrl(new Url('http://example.com/example-2'));
$siteMap->registerBasicUrl('http://example.com/example-3');

$siteMap
    ->registerBasicUrl('http://example.com/example-4');

// save as sitemap.xml
$siteMap->writeToFile('sitemap.xml');

echo $siteMap;
```

### Create Sitemap Index

[](#create-sitemap-index)

You can provide multiple Sitemap files, but each Sitemap file that you provide must have no more than 50,000 URLs and must be no larger than 50MB (52,428,800 bytes). If you would like, you may compress your Sitemap files using gzip to reduce your bandwidth requirement; however the sitemap file once uncompressed must be no larger than 50MB. If you want to list more than 50,000 URLs, you must create multiple Sitemap files.

```
header('Content-Type: application/xml; charset=utf-8');

require 'vendor/autoload.php';

use SiteMap\SiteMap;
use SiteMap\SiteMapIndex;
use SiteMap\Entities\MapIndex;

$siteMap = new SiteMap;

$siteMap->registerBasicUrl('http://example.com/example');
$siteMap->registerBasicMapIndex('http://site.com/sitemap-1.xml');

$siteMapIndex = (new SiteMapIndex)
    ->registerSiteMap($siteMap)
    ->registerMapIndex(new MapIndex('http://site.com/sitemap-2.xml'))
    ->registerMapIndex(new MapIndex('http://site.com/sitemap-3.xml', new DateTime));

// save as sitemap.xml
$siteMapIndex->writeToFile('sitemap.xml');

echo $siteMapIndex;
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

2133d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/777c318b28a6be9845f925aa3916d3c1d6c09a53d454ffb5fb43a1c3170e17ba?d=identicon)[bilaleren](/maintainers/bilaleren)

---

Top Contributors

[![bilaleren](https://avatars.githubusercontent.com/u/48865064?v=4)](https://github.com/bilaleren "bilaleren (5 commits)")

---

Tags

Sitemapsitemap.xmlPHP Sitemap

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[presta/sitemap-bundle

A Symfony bundle that provides tools to build your application sitemap.

3929.4M28](/packages/presta-sitemap-bundle)[samdark/sitemap

Sitemap and sitemap index builder

5491.4M37](/packages/samdark-sitemap)[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.4M46](/packages/nystudio107-craft-seomatic)[vipnytt/sitemapparser

XML Sitemap parser class compliant with the Sitemaps.org protocol.

772.2M10](/packages/vipnytt-sitemapparser)[ultrono/laravel-sitemap

Sitemap generator for Laravel 11, 12 and 13

36412.6k6](/packages/ultrono-laravel-sitemap)[cebe/luya-module-sitemap

sitemap.xml module for luya CMS

115.9k](/packages/cebe-luya-module-sitemap)

PHPackages © 2026

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