PHPackages                             hudhaifas/silverstripe-googlesitemaps-queued - 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. hudhaifas/silverstripe-googlesitemaps-queued

ActiveSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

hudhaifas/silverstripe-googlesitemaps-queued
============================================

Generate and upload static XML sitemaps using silverstripe-googlesitemaps and silverstripe-queuedjobs.

0647PHP

Since Sep 10Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/hudhaifas/silverstripe-googlesitemaps-queued)[ Packagist](https://packagist.org/packages/hudhaifas/silverstripe-googlesitemaps-queued)[ RSS](/packages/hudhaifas-silverstripe-googlesitemaps-queued/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

SilverStripe Google Sitemaps Queued
===================================

[](#silverstripe-google-sitemaps-queued)

This module extends [wilr/silverstripe-googlesitemaps](https://github.com/wilr/silverstripe-googlesitemaps) and [symbiote/silverstripe-queuedjobs](https://github.com/symbiote/silverstripe-queuedjobs) to generate static sitemap XML files (chunks and index) in a queued and scalable way.

Features
--------

[](#features)

- Generates static sitemap chunks and index files using `wilr/silverstripe-googlesitemaps`
- Runs as a background job using `symbiote/silverstripe-queuedjobs` (supports long-running `LARGE` jobs)
- Supports multilingual sites using [tractorcow/silverstripe-fluent](https://github.com/tractorcow/silverstripe-fluent), with per-locale domain context
- Saves output to `public/sitemap/{locale}`
- Optionally uploads all sitemap files (XML + XSL) to an S3-compatible bucket such as DigitalOcean Spaces
- Includes a proxy controller so sitemap files can be served under your app domain for Google Search Console compliance

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

[](#installation)

Install via Composer:

```
composer require hudhaifas/silverstripe-googlesitemaps-queued
```

Then run dev/build:

```
vendor/bin/sake dev/build flush=all
```

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

[](#configuration)

You can schedule the job using the CMS UI or declare it in YAML as a default recurring job:

```
SilverStripe\Core\Injector\Injector:
  Symbiote\QueuedJobs\Services\QueuedJobService:
    properties:
      defaultJobs:
        DailyEnglishSitemapJob:
          type: Hudhaifas\GoogleSitemapsQueued\Job\GenerateSitemapJob
          filter:
            JobTitle: 'Generate en Sitemap XML (queued)'
          construct:
            0: 'en'
            1: 'https://en.example.com'
          startDateFormat: 'Y-m-d H:i:s'
          startTimeString: 'tomorrow 01:00'
          recreate: true

        DailyArabicSitemapJob:
          type: Hudhaifas\GoogleSitemapsQueued\Job\GenerateSitemapJob
          filter:
            JobTitle: 'Generate ar Sitemap XML (queued)'
          construct:
            0: 'ar'
            1: 'https://ar.example.com'
          startDateFormat: 'Y-m-d H:i:s'
          startTimeString: 'tomorrow 02:00'
          recreate: true
```

Environment Variables
---------------------

[](#environment-variables)

If uploading to S3-compatible storage (e.g. DigitalOcean Spaces):

```
AWS_ACCESS_KEY_ID=your-key
AWS_SECRET_ACCESS_KEY=your-secret
AWS_REGION=fra1
AWS_BUCKET_NAME=my-bucket-name
AWS_PUBLIC_BUCKET_PREFIX=public/assets
AWS_ENDPOINT=https://fra1.digitaloceanspaces.com
AWS_PUBLIC_CDN_PREFIX=https://cdn.example.com/public/
```

If `AWS_BUCKET_NAME` is not set, the sitemap files will only be saved locally to `public/sitemap/{locale}`.

How Domain and URL Generation Works
-----------------------------------

[](#how-domain-and-url-generation-works)

- All links and asset references in the generated XML (including `` and ``) are created using `SitemapBase::AbsoluteLink()`.
- If `AWS_PUBLIC_CDN_PREFIX` is set, it is used as the base for all URLs. Otherwise, the app’s `Director::absoluteBaseURL()` is used.
- For correct domain generation in worker contexts (e.g., `localhost` in cloud CI runners or App Platform), you must explicitly pass the correct domain to the job constructor (e.g., `https://en.example.com`).
- This domain is injected during generation using `SitemapHelper::withAlternateBaseURL()`.

XSL Stylesheet Support
----------------------

[](#xsl-stylesheet-support)

Generated sitemap XML files include a reference to an XSL file so they are human-readable in the browser. These files:

- `styleSheet.xsl` – used by individual sitemap chunks
- `styleSheetIndex.xsl` – used by the main sitemap index

Both files are rendered dynamically during the job’s first step and uploaded alongside the XML files. URLs are made relative and CDN-compatible to avoid cross-origin issues.

Proxying Sitemap URLs for Google Search Console
-----------------------------------------------

[](#proxying-sitemap-urls-for-google-search-console)

**Google Search Console (GSC) only accepts sitemap URLs that are served from the same domain as the site being verified.**

If your sitemap files are hosted on a CDN like DigitalOcean Spaces, this module includes a `SitemapProxyController` that allows you to serve those files via your app domain.

### Example

[](#example)

If a file is uploaded to:

```
https://cdn.example.com/public/sitemap/en/sitemap.xml

```

And your site domain is:

```
https://en.example.com

```

Then you should **submit this URL to Google Search Console**:

```
https://en.example.com/sitemap/en/sitemap.xml

```

This request is handled by `SitemapProxyController` and will issue a 301 redirect to the CDN-hosted file:

```
https://cdn.example.com/public/sitemap/en/sitemap.xml

```

Running Large Jobs
------------------

[](#running-large-jobs)

This job is registered as a `LARGE` job type and must be processed using the `large` queue. To run it manually or via cron:

```
vendor/bin/sake dev/tasks/ProcessJobQueueTask queue=large
```

Example cron job (every 15 minutes):

```
*/15 * * * * /path/to/vendor/bin/sake dev/tasks/ProcessJobQueueTask queue=large
```

Access Control
--------------

[](#access-control)

By default, the `GenerateSitemapJob` runs as an **anonymous (non-authenticated)** user:

```
public function getRunAsMemberID()
{
    return 0;
}
```

This ensures that the sitemap only includes publicly accessible pages, avoiding pages that require login or specific member roles. If your application requires indexing private pages for a secured crawler or internal search engine, you may override this behavior by extending the job and modifying `getRunAsMemberID()` to return a valid member ID.

Testing Locally
---------------

[](#testing-locally)

To queue and run a job manually in code:

```
use Symbiote\QueuedJobs\Services\QueuedJobService;
use Hudhaifas\GoogleSitemapsQueued\Job\GenerateSitemapJob;

singleton(QueuedJobService::class)->queueJob(
    new GenerateSitemapJob('en', 'https://en.example.com')
);
```

To process it:

```
vendor/bin/sake dev/tasks/ProcessJobQueueTask queue=large
```

License
-------

[](#license)

MIT

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance40

Moderate activity, may be stable

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity14

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5335447?v=4)[Hudhaifa](/maintainers/hudhaifas)[@hudhaifas](https://github.com/hudhaifas)

---

Top Contributors

[![hudhaifas](https://avatars.githubusercontent.com/u/5335447?v=4)](https://github.com/hudhaifas "hudhaifas (2 commits)")

### Embed Badge

![Health badge](/badges/hudhaifas-silverstripe-googlesitemaps-queued/health.svg)

```
[![Health](https://phpackages.com/badges/hudhaifas-silverstripe-googlesitemaps-queued/health.svg)](https://phpackages.com/packages/hudhaifas-silverstripe-googlesitemaps-queued)
```

PHPackages © 2026

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