Exploring Shopware: Sitemap in Shopware 6 Settings

By default, Shopware generates a standard sitemap, compresses it, and then caches it in the file system. Furthermore, your e-commerce website offers advanced support for shops with many products and categories when it comes to the sitemap. Shopware splits the corresponding file into several parts and lets you generate them in the background. Although there is no way to create a visitor sitemap, the index file is generated for SEO purposes. In the article below, we describe how to find Sitemap settings in Shopware 6. After that, you will discover several ways of managing your Shopware 6 sitemap. For more tech-savvy users, we provide a brief description of how to add custom sitemap entries in Shopware 6.

Note that we provide Shopware integration with external platforms. Contact our support for further information or try our Improved Import & Export Extension for Shopware.

Get Improved Import & Export for Shopware by Firebear Studio

Table of contents

How to find sitemap in the Shopware 6 Administration

Your Shopware 6 sitemap is available under Admin -> Settings -> Shop -> Sitemap. Here, you can define the refresh time for the sitemap as well as create a refresh strategy for updating the corresponding data. Currently, the following three methods are at your service:

  • Scheduled. Choose this method if you want to generate the sitemap automatically with a scheduled task on a regular basis, storing it in the file system.
  • Live. With this refresh strategy, the system generates a new sitemap when no sitemap is available. If there is one, Shopware 6 recreates a new sitemap when the time under Refresh time has elapsed.
  • Manual. This method disables the automatic sitemap creation. You need to use the following command to generate a new sitemap:
    php bin/console sitemap:generate
    Note that you should run this command each time you add a new URL or remove an old one.

How to add custom sitemap entries in Shopware 6

As you can see, Shopware comes with a sitemap generation feature. It lets you add not only products and categories, but also additional URLs. Below, we shed light upon how to add custom entity SEO URLs to the sitemap. You will need:

  • a custom entity, 
  • a controller with a technical route for displaying each entity, 
  • a custom SEO URL.

You can add custom URLs to the sitemap with the help of the URL provider. You can add it to the system by placing a new class, which extends from ShopwareCoreContentSitemapProviderAbstractUrlProvider

Register it to the service container with the help of the shopware.sitemap_url_provider tag.

Note that it is vital to provide the following three methods:

  • getDecorated: It is enough to utilize an exception of the DecorationPatternException type for extending a class via decoration.
  • getName: Specify a technical name of your custom URL.
  • getUrls: Consider it the main method to take care of. Its purpose is to return an instance of ShopwareCoreContentSitemapStructUrlResult. The latter contains an array of all URLs that have to be added to the Shopware 6 sitemap.

You can discover the example class in the official documentation here: Add custom sitemap entries in Shopware 6.

How to Import Scale Units to Shopware 6

While you cannot import a sitemap to Shopware 6, there are many more transferable entities to choose from. With the help of our team, you can simplify and automate their transfer to and from your e-commerce website. Contact our support for more details and try our Improved Import & Export Extension for Shopware. You can use it to import any entity to Shopware 6, including data that will be used in your sitemap.

Get Improved Import & Export for Shopware by Firebear Studio

Shopware 6 Scale Units FAQ

How to find sitemap settings in Shopware 6?

You can find the scale sitemap settings in your admin under Settings -> Shop -> Sitemap.

How to update a sitemap in Shopware 6 automatically?

You can update your Shopware 6 sitemap automatically under Settings -> Shop -> Sitemap. Here, choose a scheduled or live update method.

How to update a sitemap in Shopware 6 manually?

You can update your Shopware 6 sitemap automatically under Settings -> Shop -> Sitemap. Choose a manual update method and use this command: php bin/console sitemap:generate.

How to add custom URLs to the sitemap in Shopware 6?

You can add custom URLs to the sitemap with the help of the URL provider. Follow the instructions in this guide for further information.

Discover more from WHO WILL CARE eCommerce

Subscribe now to keep reading and get access to the full archive.

Continue reading