XML Sitemap Generator: Technical Details
Technical details of the XML Sitemap Generator for OXID eShop 7: generated files, XML structure, actual flow, classes, multi-language behaviour, database table, lifecycle and limits.
XML Sitemap Generator: Technical Details
Generated files
All files are located in the output directory. With the default settings that is source/export/:
source/export/
βββ sitemap.xml # sitemap index
βββ sitemap-products.xml # products
βββ sitemap-categories.xml # categories
βββ sitemap-cms.xml # CMS pages
βββ sitemap-manufacturers.xml # manufacturers
βββ sitemap-static.xml # static URLs (only with the setting enabled)
At most one file is created per type. For products, categories, CMS pages and manufacturers it contains at most 50,000 URLs, the static sitemap has no limit. File names with numbers such as sitemap-products-1.xml are not produced by the module. The directory source/export/sitemap, which is created on activation, stays empty with the default settings.
XML structure
Every URL is written with loc, lastmod, changefreq and priority:
<url>
<loc>https://shop.example.com/product-page/</loc>
<lastmod>2026-01-15</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
lastmodcomes from the object'soxtimestampin the formatY-m-d. If the value is empty or invalid, the date of the generation is used- With hreflang enabled,
xhtml:linkentries withrel="alternate"are added, and thexhtmlnamespace is set only when such entries occur - Products get
image:imageentries withimage:locand, if the product title is not empty,image:title. Theimagenamespace is set only when images occur - The index
sitemap.xmlcontainslocandlastmod(date of the generation) per file
According to its own documentation, Google does not evaluate
changefreqandpriority, andlastmodonly if the values are reliable. The module writes the fields anyway because the sitemap protocol provides them.
Defaults per type
| Type | changefreq |
priority |
|---|---|---|
| Products | weekly |
0.8 |
| Categories | weekly |
0.7 |
| CMS pages | monthly |
0.5 |
| Manufacturers | monthly |
0.6 |
| Static URLs | value of the entry, otherwise monthly |
value of the entry, otherwise 0.5 |
Flow
graph TD
A["GenerateSitemapCommand"] --> B["Read settings and languages"]
B --> C["GenerateSitemapService"]
C --> D["Query service per type"]
D --> E["HreflangService (optional)"]
E --> F["UrlBuilderService"]
D --> F
F --> G["XmlWriterService"]
G --> H["FileWriterService"]
H --> I["sitemap-type.xml"]
I --> J["Sitemap index sitemap.xml"]
The module works without a cache, without compression (.xml.gz), without pinging search engines and without a scheduler of its own. Every generation reads the data from the database again and overwrites the files.
Classes
| Class | Task |
|---|---|
Command\GenerateSitemapCommand |
Console command mmd:sitemap:generate, options, language and type selection, output |
Service\Command\GenerateSitemapService |
Orchestrates query, hreflang, URL building, XML and writing, creates the index |
Service\Query\ProductQueryService, CategoryQueryService, CmsPageQueryService, ManufacturerQueryService |
Read the content with SQL against oxarticles, oxcategories, oxcontents, oxmanufacturers and oxseo |
Service\Query\StaticUrlQueryService |
Reads the table mmd_sitemap_static_urls |
Service\Domain\HreflangService |
Determines alternate language URLs from oxseo |
Service\Domain\UrlBuilderService |
Builds the URL with lastmod, changefreq, priority per record |
Service\Domain\XmlWriterService |
Creates sitemap and index XML with DOMDocument |
Service\Domain\FileWriterService |
Writes files, creates directories, deletes with --clear |
Service\Bridge\OxidConfigReader, OxidSettingsBridge |
Read the module settings as well as shop URL, languages and language URLs |
Core\Events |
Activation and deactivation |
Controller\Admin\* |
Admin overview and management of static URLs |
Multi-language behaviour
- Languages and their order come from the shop setting
aLanguages, the language ID is the position in that list. Whether a language is active in the storefront is not checked - For each language the command queries the SEO URLs of that language and builds the addresses from the language URL (
aLanguageURLs), falling back to the shop URL - The file name does not contain a language. Every language pass overwrites the file of the previous one, the language processed last remains
- Hreflang (
blHreflangEnabled) only takes effect if the shop has more than one language. For each object with at least two language URLs, alternates per language code are written. Anx-defaultfor the default language (sDefaultLang) is written only if the object has a URL in the default language
Database
The module creates only the table mmd_sitemap_static_urls (columns see Static URLs). All other data is read from the OXID tables without modifying them. It uses the shop's database connection as a PDO object.
Lifecycle
| Event | Effect |
|---|---|
Activation (onActivate) |
Creates source/export/sitemap and the table mmd_sitemap_static_urls if they do not exist |
Deactivation (onDeactivate) |
No action, files and data are kept |
There are no migrations. oe:module:apply-configuration only applies the module settings, not the table.
Limits
- At most 50,000 URLs per file for products, categories, CMS pages and manufacturers, the rest is cut off (the setting
iMaxUrlsis not evaluated). The static sitemap has no limit - The file size is not checked, so the protocol limit of 50 MB is not monitored
- The data of a type is loaded into memory completely and written to the file in a single write operation, there is no chunked writing
- Several shops: shop URL, language list and static URLs always come from shop ID 1. With
-s, the shop ID changes in the content queries and in the hreflang query - Product images are always included, the setting
blImagesEnabledis not evaluated
Module structure
mmd/sitemap/ # source/modules/mmd/sitemap
βββ metadata.php # module ID mmd_sitemap, settings, events
βββ services.yaml # services and console command
βββ menu.xml # admin menu "Sitemap"
βββ src/
β βββ Command/ # GenerateSitemapCommand
β βββ Controller/Admin/ # overview, static URLs
β βββ Core/Events.php # activation/deactivation
β βββ DTO/, Enum/, Model/ # value objects, types, StaticUrl model
β βββ Service/ # Bridge, Query, Domain, Command
βββ views/ # admin templates and translations