How can you set up SEO URLs in Shopware 6?
We offer this tutorial to help you define the structure for SEO URLs. SEO-friendly URLs can be created automatically. Shopware 6 has everything you need to customize them. You don't need any additional plugins. Go to Settings and find the SEO section.
Here you will see SEO URL templates. You can select a sales channel for which you want to configure the settings. You can configure URLs for all sales channels at the same time. There are templates for product detail pages, landing pages, and category pages.
Product detail page
When defining a template for the product detail page URL, you should specify the variables in Twig format. When using variables, the entity fields (landing pages, categories) should contain the data. If variables refer to empty fields, no URLs will be created for the associated entities. You can choose from different variables. There are multi-level variables that are not added in full. You then have to adjust them manually in the SEO template field. For example, you have to manually add .name to the variable {{ product.translated }}.
Landing pages
When customizing templates for landing pages, you can select different variables. Here are a few examples:
{{landingPage.cmsPageId}}
{{landingPage.metaTitle}}
{{landingPage.createdAt}}
Category page
Many variables are available for customizing the template for category pages:
{{ category.id }}
{{ category.translated.metaTitle }}
{{ category.active }}
Some variables contain content that changes URLs regularly. Avoid using these variables, as they negatively affect SEO ranking.
You can also add filters to the SEO template. To separate filters, use “|” after the variable within {{}}. The template looks like this:
{ product.translated.name|lower }}/{{ product.productNumber }}
You can also append a for loop in ‘{{ part|lower }}’. Here is an example for category pages:
{% for part in category.seoBreadcrumb %}{{ part|lower }}/{% endfor %}
Finally, click “Save.” If you reload the website and do not notice any changes, you must first clear the shop's caches and also use the indexer again. Go to Settings and open Caches and Indexes.
Then you must delete the caches. After this procedure, you must update the indexes. Indexes are data structures with stored information. The update is necessary so that the changes you have made become current.
Meta title and meta description
These are important elements that customers see in search results. Shopware 6 offers full control over these and allows you to set individual SEO titles and descriptions for each product or category. To do this, click on Catalogs – Products. Next, select a specific product and click on SEO.
