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

ActiveLibrary

adamb/sitemap
=============

Create a sitemap for your domain, crawls all URL's except those with nofollow links and those explicitly stated to ignore to create the sitemap

1.2.4(3w ago)1190MITPHP

Since Mar 24Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/adambinnersley/sitemap)[ Packagist](https://packagist.org/packages/adamb/sitemap)[ RSS](/packages/adamb-sitemap/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (6)Versions (6)Used By (0)

PHP XML Sitemap Generator
=========================

[](#php-xml-sitemap-generator)

Generate a XML sitemap for a given URL. This class crawls any given website to create an XML sitemap for the domain.

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

[](#installation)

Installation is available via [Composer/Packagist](https://packagist.org/packages/adamb/database), you can add the following line to your `composer.json` file:

```
"adamb/sitemap": "^1.0"
```

or

```
composer require adamb/sitemap
```

Usage
-----

[](#usage)

Example of usage can be found below:

```
// Method 1
$sitemap = new Sitemap\Sitemap('http://www.yourwebsite.co.uk');
$sitemap->createSitemap(); // Returns true if sitemap created else will return false

// Method 2
$sitemap = new Sitemap\Sitemap();
$sitemap->setDomain('http://www.yourwebsite.co.uk');
$sitemap->createSitemap(); // Returns true if sitemap created else will return false
```

Change file creation location
-----------------------------

[](#change-file-creation-location)

By default the sitemap.xml file is created in the document root but this can be altered using the following method.

```
$sitemap = new Sitemap\Sitemap('http://www.yourwebsite.co.uk');

// This should be an absolute path
$sitemap->setFilePath($_SERVER['DOCUMENT_ROOT'].'sitemaps/');

// or

$sitemap->setFilePath('C:\Inetpub\mywebsite.co.uk\httpdocs\sitemaps\\');

$sitemap->createSitemap();
```

Sitemap creation options
------------------------

[](#sitemap-creation-options)

By default the sitemap creates a XSL stylesheet along with the sitemap. You can also change the level of the link to include in the sitemap (e.g. Only include links within 3 clicks of the homepage) and also change the filename of the sitemap on creation.

```
// To not include the XSL stylesheet set the first value to false when calling createSitemap();
$sitemap->createSitemap(false);

// To only include links within 3 click set the second value to 3
$sitemap->createSitemap(true, 3);

// To change the filename set the third value to your filename (excluding extension)
$sitemap->createSitemap(true, 5, 'mysitemapfile');
```

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance89

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

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

Total

5

Last Release

21d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1990042?v=4)[Adam Binnersley](/maintainers/AdamBinnersley)[@adambinnersley](https://github.com/adambinnersley)

---

Top Contributors

[![adambinnersley](https://avatars.githubusercontent.com/u/1990042?v=4)](https://github.com/adambinnersley "adambinnersley (68 commits)")

---

Tags

sitemapsitemap-buildersitemap-generatorsitemap-phpsitemapperxml-sitemap

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k21](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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