https://github.com/alexecus/sitemaper
A very flexible PHP sitemap generator library to suit all your sitemap needs
https://github.com/alexecus/sitemaper
php sitemap sitemap-generator sitemap-php sitemap-xml
Last synced: 5 months ago
JSON representation
A very flexible PHP sitemap generator library to suit all your sitemap needs
- Host: GitHub
- URL: https://github.com/alexecus/sitemaper
- Owner: alexecus
- Created: 2018-11-11T15:20:36.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-24T08:38:32.000Z (over 7 years ago)
- Last Synced: 2025-05-17T05:17:34.905Z (about 1 year ago)
- Topics: php, sitemap, sitemap-generator, sitemap-php, sitemap-xml
- Language: PHP
- Homepage: https://alexecus.com/project/sitemaper
- Size: 66.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

[](https://codeclimate.com/github/alexecus/sitemaper/maintainability)
[](https://codeclimate.com/github/alexecus/sitemaper/test_coverage)
**Sitemaper** is a very flexible PHP sitemap generator library that you can use to
generate sitemap files. It can generate into various format such as XML.
It can also output the sitemap as raw data so you can bind it to a controller for example.
**View complete documentation on the [official website](https://alexecus.com/project/sitemaper)**
```php
use Alexecus\Sitemaper\Sitemap;
$sitemap = new Sitemap('http://mysite.com');
$sitemap
->addItem('/', [
'lastmod' => '2020-05-15',
'changefreq' => 'monthly',
'priority' => '1.0',
])
->addItem('/page', [
'lastmod' => '2020-05-15',
'changefreq' => 'daily',
'priority' => '0.8',
]);
$sitemap->write('sitemap.xml');
```
### Installation
Install via Composer
```bash
$ composer require alexecus/sitemaper
```
### What can Sitemaper do
* Generate XML files
* Output sitemap XML response from your controller
* Generate sitemap index files
### Why choose Sitemaper
* Probably the most flexible, you can even change the transformers and writers
* Support for Google sitemap extensions
* Support for sitemap index files
* 100% test code coverage
* Fluent usage
* Fully documented