In short. Add |lower to the product value or breadcrumb part in the Shopware SEO template, then rebuild the SEO index.
Definition: Shopware SEO URL templates are Twig expressions used to build URLs for product detail pages and categories. Add the
lowerfilter to a product value or to each category breadcrumb part when the template should output lowercase text.
Key facts
- Shopware's SEO settings define the structure of SEO URLs for product detail pages and categories with variables. The Shopware SEO settings documentation also documents Twig filters in these templates.
- Product detail URL variables use Twig format. The documented product example applies
|lowertoproduct.translated.nameand leavesproduct.productNumberas a separate value. - The category template uses the default category structure, described as a breadcrumb, and the documented loop reads
category.seoBreadcrumb. - Shopware says filters are added after a variable with the
|separator inside{{}}. - After a template change, Shopware requires an SEO index rebuild so that the URLs are updated.
Where does |lower go in a product SEO template?
Shopware's product detail page setting accepts variables in Twig format. The lower filter belongs directly after the value that should be transformed. The documented comparison keeps the product number outside the filter:
{{ product.translated.name|lower }}/{{ product.productNumber }}
This expression lowers the product name and then appends a slash and the product number. Twig's lower filter documentation defines the filter as converting a value to lowercase and states that Twig uses PHP's mb_strtolower internally.
Shopware also documents that product URL variables can be multi-level. Its example uses product.translated.name, so the complete property path must be kept when the filter is added. The filter is attached to the final value, after name.
How do you lowercase category breadcrumb parts?
Shopware describes the default category structure as the breadcrumb. Its category example loops through category.seoBreadcrumb, assigns each item to part, and adds a slash after each item. Put the filter on part inside that loop:
{% for part in category.seoBreadcrumb %}{{ part|lower }}/{% endfor %}
The filter therefore applies to each breadcrumb segment as the loop renders it. The slash remains outside the filtered value, matching Shopware's documented example. The page also shows the unfiltered form, {% for part in category.seoBreadcrumb %}{{ part }}/{% endfor %}, which identifies the exact value changed by |lower.
What must you do after changing the template?
Shopware's SEO settings include a Sales channel selector. The documentation says it can configure the setting globally for all sales channels or for a selected sales channel, so check the scope before editing a template. After saving a change, rebuild the SEO index from the console:
php bin/console dal:refresh:index
Shopware states that this rebuild is necessary after SEO template changes so the URLs are updated. The filter changes the value emitted by the template; the index rebuild makes the changed URL values available to the SEO URL index.
Related terms
- When must Shopware's SEO URL index be rebuilt?
- Where can a Shopware category's generated SEO URL be overridden?
FAQ
Does |lower apply to every part of a product URL?
It applies to the value immediately before it. In Shopware's product example, the product name has the filter and the product number remains a separate template value.
Is lower a Shopware-only filter?
Shopware points to the available Twig filters for SEO templates. Twig documents lower as a filter that converts a value to lowercase.
Why can a changed template leave old URL values in the index?
Shopware says to rebuild the SEO index after changing an SEO template, using php bin/console dal:refresh:index.
Sources
- Shopware, "Shopware 6 - Settings - SEO-settings", undated
- Twig, "lower - Filters - Documentation - Twig PHP", undated
Check how a page reads to answer engines. Open the GEO score analyzer