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

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

gimucco/sitemap
===============

Generate Sitemaps and Sitemap Index for SEO

1.3(1y ago)197GPL-3.0-onlyPHPPHP &gt;=7.4

Since Mar 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/andreaolivato/Sitemap)[ Packagist](https://packagist.org/packages/gimucco/sitemap)[ RSS](/packages/gimucco-sitemap/feed)WikiDiscussions main Synced today

READMEChangelog (5)DependenciesVersions (8)Used By (0)

Sitemap
=======

[](#sitemap)

Dynamic Sitemap generator in PHP with multi-sitemap and sitemap index support. Optional support for multi-language via hreflang

Features
--------

[](#features)

Current features include:

- Generate Single Sitemap
- Generate Multiple Sitemaps if submitting more than 500,000 URLs
- Automatically generate Sitemap Index
- Specify if URL is mobile-ready
- Multi-language support with hreflang
- Customise names and paths to save the XML
- Ping Google

Working on
----------

[](#working-on)

- Image support
- Video Support

Requirements
------------

[](#requirements)

PHP &gt;= 7.4

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

[](#installation)

Install via Composer

```
composer require gimucco/sitemap

```

Code Example for generating a simple sitemap
--------------------------------------------

[](#code-example-for-generating-a-simple-sitemap)

The below code shows how to generate a simple sitemap starting from an array of URLs. Refer to the `examples` folder for more detailed examples and options.

```
use Gimucco\Sitemap\Runner;
use Gimucco\Sitemap\Url;

require_once __DIR__.'/../vendor/autoload.php';

// This is the Path where the xml files will be saved.
$sitemaps_folder_path = __DIR__.'/sitemaps/';
// This is the URL corresponding to the path above
$sitemaps_folder_url = 'https://yourdomain.com/sitemaps/';
// Array containing your URLs
$urls = ['https://yourdomain.com/', 'https://yourdomain.com/contacts', 'https://yourdomain.com/signup', 'https://yourdomain.com/login'];

// Starting the Runner
// First parameter is the local path to the folder where Sitemaps will be saved
// Second parameter is the URL to reach the sitemaps
// Third parameter are options, E.g. Verbosity
$_Runner = new Runner($sitemaps_folder_path, $sitemaps_folder_url, [Runner::OPTION_VERBOSE]);
foreach ($urls as $url) {
	// Push the URL to the sitemap
	// First parameter is the URL of the resource you want to add to the sitemap
	// Second parameter is the Date of last update in ISO8601 format
	// Third parameter is  the priority (0.1 to 1)
	// Fourth parameter is the update frequency (e.g. daily)
	$_Runner->pushURL($url, Url::timeNow(), Url::PRIORITY_HIGHEST, Url::FREQ_ALWAYS);
}
// Write Sitemaps and cleanup
$_Runner->end();
// Optional, send Ping to Google to refresh the Sitemap
$_Runner->pingGoogle();
```

Utilities: Frequency
--------------------

[](#utilities-frequency)

The **Url** class contains default priority values in public constants.

```
Sitemap::FREQ_ALWAYS; // always
Sitemap::FREQ_HOURLY; // hourly
Sitemap::FREQ_DAILY; // daily
Sitemap::FREQ_WEEKLY; // weekly
Sitemap::FREQ_MONTHLY; // monthly
Sitemap::FREQ_YEARLY; // yearly
Sitemap::FREQ_NEVER ; // never
```

Utilities: Priority
-------------------

[](#utilities-priority)

The **Url** class contains default priority values in public constants.

```
Sitemap::PRIORITY_HIGHEST; //1;
Sitemap::PRIORITY_HIGHER; //0.9;
Sitemap::PRIORITY_HIGH; //0.7;
Sitemap::PRIORITY_AVERAGE; //0.5;
Sitemap::PRIORITY_LOW; //0.3;
Sitemap::PRIORITY_LOWER; //0.2;
Sitemap::PRIORITY_LOWEST; //0.1;
```

Utilities: Last Update
----------------------

[](#utilities-last-update)

The **Url** class contains public static methods to convert dates and timestamps to the correct format for Sitemaps: ISO8601

```
Url::convertDateToISO8601("2022-03-13 12:34:56");
// Output: 2022-03-13T12:34:56+00:00

Url::convertTimestampToISO8601(1647147559);
// Output: 2022-03-13T04:59:19+00:00
```

Furthermore, the **Url** class contains standard times (already formatted in ISO8601) as public static methods.

```
Sitemap::timeNow(); // Now
Sitemap::timeYesterday(); // 24 hours ago
Sitemap::timeOneWeek(); // One week ago {
Sitemap::timeOneMonth(); // One month ago
```

Examples
--------

[](#examples)

Refer to the `examples` folder for quick examples on how to use the various options

Available Examples:

- Small, simple sitemap
- Large, random sitemap
- Complex sitemap with multiple languages per URL
- Rename sitemap

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

Recently: every ~234 days

Total

7

Last Release

581d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/21fcc5ef8debc55ef7e12afd6b4989832af61994a7d9412bdcd2fd939d512e59?d=identicon)[andreaolivato](/maintainers/andreaolivato)

---

Top Contributors

[![andreaolivato](https://avatars.githubusercontent.com/u/100728?v=4)](https://github.com/andreaolivato "andreaolivato (1 commits)")

---

Tags

phpseositemap

### Embed Badge

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

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

PHPackages © 2026

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