PHPackages                             vdlp/oc-sitemap-plugin - 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. vdlp/oc-sitemap-plugin

ActiveOctober-plugin[Utility &amp; Helpers](/categories/utility)

vdlp/oc-sitemap-plugin
======================

A sitemap.xml generator for October CMS.

2.4.0(1y ago)613.6k↓54.6%31GPL-2.0-onlyPHPPHP ^8.0.2CI failing

Since Nov 5Pushed 3w ago9 watchersCompare

[ Source](https://github.com/vdlp/oc-sitemap-plugin)[ Packagist](https://packagist.org/packages/vdlp/oc-sitemap-plugin)[ RSS](/packages/vdlp-oc-sitemap-plugin/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (3)Versions (13)Used By (1)

 [![](https://camo.githubusercontent.com/f79b9b1e16203dab3d1ba57744b6a76ef2d09616b612a81e2fd9449925fc66d9/68747470733a2f2f706c7567696e732e76646c702e6e6c2f6f63746f626572636d732f69636f6e732f56646c702e536974656d61702e737667)](https://camo.githubusercontent.com/f79b9b1e16203dab3d1ba57744b6a76ef2d09616b612a81e2fd9449925fc66d9/68747470733a2f2f706c7567696e732e76646c702e6e6c2f6f63746f626572636d732f69636f6e732f56646c702e536974656d61702e737667)

Vdlp.Sitemap
============

[](#vdlpsitemap)

 *This plugin allows developers to create a sitemap.xml using a sitemap definition generator.*

 [![](https://camo.githubusercontent.com/c1343f0597e4da8800851973a567636e5fa822621ea8a7cfbbf7206f83403bb6/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f7068702f76646c702f6f632d736974656d61702d706c7567696e)](https://camo.githubusercontent.com/c1343f0597e4da8800851973a567636e5fa822621ea8a7cfbbf7206f83403bb6/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f7068702f76646c702f6f632d736974656d61702d706c7567696e) [![](https://camo.githubusercontent.com/6a95e9662eb14cb69a5efdb5291540199208ccd774b1ce5135586d017932cec2/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f6c6963656e73652f76646c702f6f632d736974656d61702d706c7567696e)](https://camo.githubusercontent.com/6a95e9662eb14cb69a5efdb5291540199208ccd774b1ce5135586d017932cec2/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f6c6963656e73652f76646c702f6f632d736974656d61702d706c7567696e) [![](https://camo.githubusercontent.com/183abacb40b95a4080bc0afac6edd14dd755c82969eb47ca2ecb2bfff00ef671/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f762f76646c702f6f632d736974656d61702d706c7567696e2f6c6174657374)](https://camo.githubusercontent.com/183abacb40b95a4080bc0afac6edd14dd755c82969eb47ca2ecb2bfff00ef671/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f762f76646c702f6f632d736974656d61702d706c7567696e2f6c6174657374) [![](https://camo.githubusercontent.com/5457e68a1051820661648bd93ffaf69f8ab513920dd19c261ff3ac5a646d0ed2/68747470733a2f2f62616467656e2e6e65742f62616467652f636d732f4f63746f626572253230434d53)](https://camo.githubusercontent.com/5457e68a1051820661648bd93ffaf69f8ab513920dd19c261ff3ac5a646d0ed2/68747470733a2f2f62616467656e2e6e65742f62616467652f636d732f4f63746f626572253230434d53) [![](https://camo.githubusercontent.com/8ef1333110cedb8be792e165e201c69d776d92c196b7a26938e50ad4ddfb0f84/68747470733a2f2f62616467656e2e6e65742f62616467652f747970652f706c7567696e)](https://camo.githubusercontent.com/8ef1333110cedb8be792e165e201c69d776d92c196b7a26938e50ad4ddfb0f84/68747470733a2f2f62616467656e2e6e65742f62616467652f747970652f706c7567696e) [![](https://camo.githubusercontent.com/0a00835b8e5510725852e9ec5cc7014ef7e57c778a9c9368db73474ea1b2e562/68747470733a2f2f706c7567696e732e76646c702e6e6c2f6f63746f626572636d732f62616467652f696e7374616c6c6174696f6e732e7068703f706c7567696e3d76646c702d736974656d6170)](https://camo.githubusercontent.com/0a00835b8e5510725852e9ec5cc7014ef7e57c778a9c9368db73474ea1b2e562/68747470733a2f2f706c7567696e732e76646c702e6e6c2f6f63746f626572636d732f62616467652f696e7374616c6c6174696f6e732e7068703f706c7567696e3d76646c702d736974656d6170)

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

[](#requirements)

- PHP 8.0.2 or higher
- Supports October CMS `3.x` or `4.x`

Usage
-----

[](#usage)

### Sitemap definitions generator

[](#sitemap-definitions-generator)

To generate sitemap items you can create your own sitemap definition generator.

Example:

```
final class DefinitionGenerator implements Contracts\DefinitionGenerator
{
    public function getDefinitions(): Definitions
    {
        $definitions = new Definitions();

        for ($i = 0; $i < 100; $i++) {
            $definitions->addItem(
                (new Definition)->setModifiedAt(Carbon::now())
                    ->setPriority(1)
                    ->setUrl('example.com/page/' . $i)
                    ->setChangeFrequency(Definition::CHANGE_FREQUENCY_ALWAYS)
            );
        }

        return $definitions;
    }
}
```

Register your generator in the `boot` method of your plugin class:

```
Event::listen(Contracts\SitemapGenerator::GENERATE_EVENT, static function(): DefinitionGenerator {
    return new DefinitionGenerator();
});
```

You can also register multiple generators:

```
Event::listen(Contracts\SitemapGenerator::GENERATE_EVENT, static function(): array {
    return [
        new DefinitionGeneratorOne(),
        new DefinitionGeneratorTwo(),
        // ..
    ];
});
```

### Invalidate sitemap cache

[](#invalidate-sitemap-cache)

You can fire an event to invalidate the sitemap cache

```
Event::fire(Contracts\SitemapGenerator::INVALIDATE_CACHE_EVENT);
```

Or resolve the generator instance and use the invalidate cache method

```
/** @var SitemapGenerator $sitemapGenerator */
$sitemapGenerator = resolve(Contracts\SitemapGenerator::class);
$sitemapGenerator->invalidateCache();
```

Update / Add / Delete definitions in cache
------------------------------------------

[](#update--add--delete-definitions-in-cache)

First resolve the sitemap generator

```
/** @var SitemapGenerator $sitemapGenerator */
$sitemapGenerator = resolve(Contracts\SitemapGenerator::class);
```

### Add definitions

[](#add-definitions)

```
$sitemapGenerator->addDefinition(
    (new Definition())
        ->setUrl('example.com/new-url')
        ->setModifiedAt(Carbon::now())
        ->setChangeFrequency(Definition::CHANGE_FREQUENCY_YEARLY)
        ->setPriority(5)
);
```

### Update definitions

[](#update-definitions)

> Note, definitions are updated by their URL.

```
$sitemapGenerator->updateDefinition(
    (new Definition())
        ->setUrl('example.com/page/1')
        ->setModifiedAt(Carbon::parse('1900-10-10'))
        ->setPriority(7)
        ->setChangeFrequency(Definition::CHANGE_FREQUENCY_HOURLY),
    'example.com/page/0' // (optional) specify the url to update in cache, when old url is null the definition url will be used.
);
```

### Update or add definitions

[](#update-or-add-definitions)

```
$sitemapGenerator->updateOrAddDefinition(
    (new Definition())
        ->setUrl('example.com/create-or-add')
        ->setModifiedAt(Carbon::now())
        ->setChangeFrequency(Definition::CHANGE_FREQUENCY_YEARLY)
        ->setPriority(5),
    null // (optional) specify the url to update in cache, when old url is null the definition url will be used.
);
```

### Delete definitions

[](#delete-definitions)

```
$sitemapGenerator->deleteDefinition('example.com/new-url');
```

Exclude URLs from sitemap
-------------------------

[](#exclude-urls-from-sitemap)

```
Event::listen(SitemapGenerator::EXCLUDE_URLS_EVENT, static function (): array {
    return [
        'example.com/page/1',
    ];
});
```

Configuration
-------------

[](#configuration)

Add the plugin configuration to your config folder:

```
php artisan vendor:publish --provider="Vdlp\Sitemap\ServiceProvider" --tag="config"

```

You can change the amount of seconds the sitemap is cached in your `.env` file. You can also cache the sitemap forever.

```
VDLP_SITEMAP_CACHE_TIME=3600
VDLP_SITEMAP_CACHE_FOREVER=false
```

### ConfigResolver

[](#configresolver)

Optionally you can override how the sitemap config should be resolved by giving your own ConfigResolver implementation in the config file. This can be useful for multisite projects, where the sitemap should be cached per domain.

```
use Illuminate\Contracts\Config\Repository;
use Illuminate\Http\Request;
use Vdlp\Sitemap\Classes\Contracts\ConfigResolver;
use Vdlp\Sitemap\Classes\Dto\SitemapConfig;

final class MultisiteConfigResolver implements ConfigResolver
{
    public function __construct(private Repository $config, private Request $request)
    {
    }

    public function getConfig(): SitemapConfig
    {
        $domain = $this->request->getHost();

        return new SitemapConfig(
            'vdlp_sitemap_cache_' . $domain,
            'vdlp_sitemap_definitions_' . $domain,
            sprintf('vdlp/sitemap/sitemap_%s.xml', $domain),
            (int) $this->config->get('sitemap.cache_time', 3600),
            (bool) $this->config->get('sitemap.cache_forever', false)
        );
    }
}
```

Issues
------

[](#issues)

If you have issues using this plugin. Please create an issue on GitHub or contact us at octobercms@vdlp.nl.

Contribution
------------

[](#contribution)

Any help is appreciated. Or feel free to create a Pull Request on GitHub.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance75

Regular maintenance activity

Popularity32

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 78.4% 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 ~229 days

Recently: every ~362 days

Total

10

Last Release

365d ago

Major Versions

1.1.0 → 2.0.02021-07-13

PHP version history (6 changes)1.0.0PHP &gt;=7.1

1.0.2PHP ^7.1

1.1.0PHP ^7.1||^8.0

2.0.0PHP ^7.4 || ^8.0

2.1.0PHP ^8.0.2

2.2.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/ed365dfb5c3f4b31be2bf8ad39d1541c4c35be295e94a80ed39a4b26204355d0?d=identicon)[vdlp](/maintainers/vdlp)

---

Top Contributors

[![adrenth](https://avatars.githubusercontent.com/u/5699988?v=4)](https://github.com/adrenth "adrenth (40 commits)")[![sander-beenen](https://avatars.githubusercontent.com/u/2843816?v=4)](https://github.com/sander-beenen "sander-beenen (7 commits)")[![jacobdekeizer](https://avatars.githubusercontent.com/u/15017400?v=4)](https://github.com/jacobdekeizer "jacobdekeizer (4 commits)")

---

Tags

laraveloctober-cmsoctobercmsphpphp7sitemap-generatorsitemap-xml

### Embed Badge

![Health badge](/badges/vdlp-oc-sitemap-plugin/health.svg)

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

###  Alternatives

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.5k10](/packages/helsingborg-stad-municipio)[rainlab/builder-plugin

Builder plugin for October CMS

17147.6k1](/packages/rainlab-builder-plugin)[mediawiki/maps

Adds various mapping features to MediaWiki

84152.3k3](/packages/mediawiki-maps)[rainlab/pages-plugin

Pages plugin for October CMS

12253.8k4](/packages/rainlab-pages-plugin)[rainlab/user-plugin

User plugin for October CMS

11955.0k15](/packages/rainlab-user-plugin)[starcitizentools/citizen-skin

A beautiful, usable, responsive MediaWiki skin with in-depth extension support. Originally developed for the Star Citizen Wiki.

3376.6k](/packages/starcitizentools-citizen-skin)

PHPackages © 2026

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