Marcus
Marcus

Reputation: 1017

How can I convert all SEO urls to lowercase in Shopware 6?

I want to have only lowercase SEO URLs in my Shopware 6 shop. How can I achieve this in the Administration area of Shopware 6?

Upvotes: 1

Views: 853

Answers (2)

Alex
Alex

Reputation: 35008

Adding to the answer of Marcus:

  1. after adding the |lower filter in the SEO settings, you need to re-build the URL indices which can also be done via the systems menu.
  2. There might be cases where the URL is still using uppercase, this can happen if URLs where imported or changed after automatic generation.

You could use the SQL query

UPDATE seo_url SET seo_path_info = LOWER(seo_path_info);

once to make all existing SEO paths lowercase.

Use this at your own risk, as former existing links using upper-case might now cause 404 errors. So there is a chance that this might have a negative impact on SEO.

Upvotes: 1

Marcus
Marcus

Reputation: 1017

Add the lower filter from Twig to your variables in the Settings > SEO menu.

For example:

{{ product.productNumber }}

becomes

{{ product.productNumber|lower }}

Upvotes: 3

Related Questions