You are currently viewing the article on an older Shopware version!
In the SEO settings you can define the structure for the SEO URLs of the product detail pages and categories. For this purpose you have a variety of variables at your disposal.
You can find the SEO settings under the settings.
With the item Sales channel (1) you can determine whether you want to configure the configuration globally for all sales channels or only for a selected sales channel.
If you have selected a specific sales channel and want to go back to the general setting, just click into the selection field and delete the content. Afterwards "All sales channels" will be displayed again.
In the first line you can specify the template for the URL of the product detail page (2). Note that the variables must be specified in Twig format. The structure here is as follows:
{{ product.name }}
Next to the field, a symbol shows you whether the variables stored in the SEO template are valid.
To the right of the field for the SEO-URL template you can choose from several variables. These are automatically added to the back of the SEO-template by clicking on the variable.
It should be noted, that the variables can be multi-level and that these are not added completely. This requires a subsequent manual adjustment in the SEO template field. You can find the complete variables in the list below.
An example of a variable that is incomplete is
{{ product.translated.name }}
In the selection on the right side the variable
{{ product.translated }}
is displayed. However, this is a "multi-level" variable and requires the complete specification of the further level. Here it is therefore necessary to add this manually.
.name
As info: If you have a product name longer than e.g. 50 characters and you want to shorten it in the SEO URL you can use this variable
{{ product.translated.name[:50] }}
Examples of article variables
Discription | Variable |
---|---|
Order number | {{ product.productNumber }} |
ID | {{ product.id }} |
Name | {{ product.name }} |
EAN | {{ product.ean }} |
Manufacturer name | {{ product.manufacturer.name }} |
Release date | {{ product.releaseDate }} |
Meta Titel | {{ product.metaTitle }} |
Discription | {{ product.description }} |
Keywords | {{ product.keywords }} |
Breadcrumb | {% for part in product.mainCategory.breadcrumb %}{{ part }}/{% endfor %} |
ParentID | {{ product.parentId }} |
Child count (number of variants) | {{ product.childCount }} |
Autoincrement | {{ product.autoIncrement }} |
Tax id | {{ product.taxId }} |
Manufacturer ID | {{ product.manufacturerId }} |
Unit ID | {{ product.unitId }} |
Active | {{ product.active }} |
Display group (group of variants) | {{ product.displayGroup }} |
Price | {{ product.price }} |
Manufacturer number | {{ product.manufacturerNumber }} |
EAN | {{ product.ean }} |
Sales (Completed sales) | {{ product.sales }} |
Stock | {{ product.stock }} |
Available stock | {{ product.availableStock }} |
Product is available | {{ product.available }} |
Delivery ID | {{ product.deliveryTimeId }} |
Restock time | {{ product.restockTime }} |
Close out | {{ product.isCloseout }} |
Purchase steps | {{ product.purchaseSteps }} |
Maximum purchase quantity | {{ product.maxPurchase }} |
Minimum purchase quantity | {{ product.minPurchase }} |
Purchase unit | {{ product.purchaseUnit }} |
Reference unit | { product.referenceUnit }} |
Free shipping costs | {{ product.shippingFree }} |
Gross purchase prices | {{ product.purchasePrices }} |
Mark product as topseller | {{ product.markAsTopseller }} |
Weight | {{ product.weight }} |
Width | {{ product.width }} |
Height | {{ product.height }} |
Length | {{ product.length }} |
Release date | {{ product.releaseDate }} |
Assigned category ID | {{ product.categoryTree }} |
Variant ID | {{ product.optionIds }} |
Property ID | {{ product.propertyIds }} |
Meta description | {{ product.metaDescription }} |
Meta title | {{ product.metaTitle }} |
Packing unit | {{ product.packUnit }} |
Packing unit plural | {{ product.packUnitPlural }} |
Variant restrictions | {{ product.variantRestrictions }} |
Display sequence | {{ product.configuratorGroupConfig }} |
Main variant ID | {{ product.mainVariantId }} |
Product configuration | {{ product.variation }} |
Tax | {{ product.tax }} |
Manufacturer | {{ product.manufacturer }} |
LayoutID | {{ product.cmsPageId }} |
Layout slot | {{ product.slotConfig }} |
Category information of the directly assigned categories | {{ product.categories }} |
Media cover ID | {{ product.coverId }} |
All customfield values of the product | {{ product.translated.customFields }} |
Tag IDs | {{ product.tagIds }} |
Average product rating number | {{ product.ratingAverage }} |
Main category | {{ product.mainCategories }} |
Internal storage object for the most favorable price determination | {{ product.cheapestPriceContainer }} |
Internal reference of the ID of the product (should not be used) | {{ product._uniqueIdentifier }} |
ID of the version of the product | {{ product.versionId }} |
Contains all translated values of the product | {{ product.translated }} |
Creation date | {{ product.createdAt }} |
Last change/update | {{ product.updatedAt }} |
Extensions of the product (plugin extensions) | {{ product.extensions }} |
Product ID | {{ product.id }} |
Version ID of the partent product | {{ product.parentVersionId }} |
Stored manufacturer version ID | {{ product.productManufacturerVersionId }} |
Product media cover version ID | {{ product.productMediaVersionId }} |
Stored CMS-layout version ID | {{ product.cmsPageVersionId }} |
Content of the additional field | {{ product.customFields.NamedesFeldes }} |
There are generally more variables available. However, since these provide content that leads to regular changes in the URL and this has a negative influence on the ranking, we will not go into this further here.
In the second field you can customize the template for the landing page (3). By default, the URL that you can assign in the landing page settings is used here. If you want to customize the template for the landing pages, the following variables are available.
Examples of landingpage variables
Beschreibung | Variable |
A 1 if the landing page is active. Otherwise a 0 | {{landingPage.active}} |
UUID of the layout assigned to the landing page | {{landingPage.cmsPageId}} |
Name of the landingpage | {{landingPage.name}} |
metaTitle of the landingpage | {{landingPage.metaTitle}} |
metaDescription of the landingpage | {{landingPage.metaTitle}} |
Keywords of the landingpage | {{landingPage.keywords}} |
SEO URL of the landingpage | {{landingPage.url}} |
UUID of the Landingpage | {{landingPage.uniqueIdentifier}} |
Versions ID of the Landingpage | {{landingPage.verionID}} |
Date of creation of the landing page | {{landingPage.createdAt}} |
Date of the last update of the landing page | {{landingPage.updatedAt}} |
Extensions potentially have the possibility to store their own values here. | {{landingPage.extensions}} |
Content of the additional field | {{landingPage.customFields.NamedesFeldes}} |
Version ID of the layout assigned to the landing page | {{landingPage.cmsPageVersionId}} |
Generally, other variables are available. However, since these provide content that leads to regular changes of the URL and this leads to a negative influence in the ranking, we recommend not to use them and we do not go into it further at this point.
In the second field you can adjust the template for the category page (4). The default category structure (the so-called breadcrumb) is used here. If you want to adjust the template for the categories, you can use the following variables.
Examples of category variables
Description | Variable | |
---|---|---|
Breadcrumb | {% for part in category.seoBreadcrumb %}{{ part }}/{% endfor %} | |
ID | {{ category.id }} | |
Name | {{ category.translated.name }} | |
Meta-Titel | {{ category.translated.metaTitle }} | |
Description | {{ category.description }} | |
Meta-description | {{ category.translated.description }} | |
Category | {{ category }} | |
ID of the parent category | {{ category.parentId }} | |
Automatic enumeration in the database | {{ category.autoIncrement }} | |
ID of assigned image | {{ category.mediaId }} | |
ID`s of the category path | {{ category.path }} | |
Category level | {{ category.level }} | |
Active | {{ category.active }} | |
Number of subcategories | {{ category.childCount }} | |
No longer used | {{ category.displayNestedProducts }} | |
Next sub category | {{ category.afterCategoryId }} | |
Custom fields | {{ category.translated.customFields }} | |
ID of the assigned layout | {{ category.cmsPageId }} | |
Productstream ID | {{ category.productStreamId }} | |
Should not be used | {{ category.slotConfig }} | |
Entered type of link. Product, category, landing page or external | {{ category.translated.linkType }} | |
The link will open in a new tab? 1 or 0 | {{ category.translated.linkNewTab }} | |
Internal link | {{ category.translated.internalLink }} | |
External link | {{ category.translated.externalLink }} | |
Hide in navigation | {{ category.visible }} | |
Category type page, link or folder | {{ category.type }} | |
Product assignment Manual selection or Dynamic product grou | {{ category.productAssignmentType }} | |
Keywords | {{ category.translated.keywords }} | |
Product allocations of the respective sales channels | {{ category.mainCategories }} | |
SEOUrls | {{ category.seoUrls }} | |
Unique identifier | {{ category._uniqueIdentifier }} | |
VersionID | {{ category.versionId }} | |
Date created | {{ category.createdAt }} | |
Modified on | {{ category.updatedAt }} | |
Extensions of the category | {{ category.extensions }} | |
ID of the parent category | {{ category.parentVersionId }} | |
Next sub category versionID | {{ category.afterCategoryVersionId }} | |
Layout versionID | {{ category.cmsPageVersionId }} | |
Associated breadcrumb | {{ category.seoBreadcrumb }} |
Generally, other variables are available. However, since these provide content that leads to regular changes of the URL and this leads to a negative influence in the ranking, we recommend not to use them and we do not go into it further at this point.
It is also possible to integrate filters into the SEO template. This for example allows, the entire URL to be written in lower case.
The filters are added with a "|" separated behind the variable within the {{}}.
For the lower case of the product name this would be possible e.g. as following
without filter
{{ product.translated.name }}/{{ product.productNumber }}
with filter
{{ product.translated.name|lower }}/{{ product.productNumber }}
With a FOR loop this is appended in the {{ part|lower }}. For category pages this looks like this
without filter
{% for part in category.seoBreadcrumb %}{{ part }}/{% endfor %}
with filter
{% for part in category.seoBreadcrumb %}{{ part|lower }}/{% endfor %}
In general you can use the available Twig filters. You can find more information on this in the Twig documentation under https://twig.symfony.com/doc/3.x/filters/index.html
Instead of redirecting Canonical URLs directly to the most recent URL using HTTP 301 (5), this function allows you to output an HTTP 301 redirect when URLs are changed. If the function is disabled, the browser will not display a note on the redirection.
After you have made changes to the SEO template, it is necessary to rebuild the index so that the URLs are updated.
You can do this from the console using the command
php bin/console dal:refresh:index
A canonical URL is the URL of the page that the search engine assumes is the most representative of several duplicated pages on your site. For example, if you have multiple URLs for the same page, such as example.com?dress=1234 and example.com/dresses/1234, the search engine will select one of them as the canonical URL.
The pages do not have to be identical. Minor changes to lists, such as sorting by price or filtering by item color, do not cause the page to be considered a separate, distinct page. The canonical URL can also be in a different domain than the duplicate.