Skip to main content

Slug Fields

A slug is a short label representing an object or page's content. The main reason for using a slug is the ability to incorporate it into URLs. Translated names can contain all UTF-8 signs, allowing for URLs to be written by people with different keyboard layouts.

Slug can contain:

  • letters
  • numbers
  • underscores
  • hyphens

Slugs in Saleor are translatable for products, categories, collections, and pages. This allows users to either maintain consistent URLs across different languages or use language-specific slugs for better localization.

The slug can either be passed in mutations or it will be automatically generated by slugifying one of the main fields on the object (e.g. name, title). Automatic generation does not apply to slug translations which can be only passed in mutations.

Example

For example: we would like to create a product called "Żółta ćma" ("yellow moth"). The expected slug for such product would be Zolta-cma.