Skip to main navigation Skip to main content Skip to page footer

Sitemap.xml configuration for products

Ensure you've the TYPO3 SEO package (typo3/cms-seo) installed and the following PageTypeSuffix mapping in your site-configuration defined:

routeEnhancers:
  PageTypeSuffix:
    type: PageType
    default: ''
    index: ''
    map:
      sitemap.xml: 1533906435

Additionally you need to include the static TypoScript template XML Sitemap (seo). Since version 5.2.0 of the Shop extension, you're able to use the static TypoScript template Shop - SEO-Sitemap configuration (shop), which uses the {$themes.configuration.container.shop} as definition for the product record container and {$themes.configuration.pages.shop.detail} ad definition for the product-url base-path (if no divergating in product canonical-field is defined).

Before version 5.2.0 you can just use the following configuration, which enables you to generate a Sitemap.xml for your products:

plugin.tx_seo {
    config {
        xmlSitemap {
            sitemaps {
                shop {
                    provider = CodingMs\Shop\XmlSitemap\RecordsXmlSitemapDataProvider
                    config {
                        table = tx_shop_domain_model_product
                        sortField = sorting
                        lastModifiedField = tstamp
                        recursive = 1
                        pid = 2
                        url {
                            pageId = 6
                            fieldToParameterMap {
                                uid = tx_shop_products[product]
                            }
                            additionalGetParameters {
                                tx_shop_products.controller = Product
                                tx_shop_products.action = show
                            }
                            useCacheHash = 1
                        }
                    }
                }
            }
        }
    }
}

It's often the case that your products are displayed in different places on a website. In order to avoid duplicate content on your website or in your sitemap.xml, you have the option to enter a canonical URL in each product. This URL will be used in the canonical tag of your HTML header and the sitemap.xml.

Shopping basket 0 Products