In the context of Wix Bookings, a slug is a user-friendly and unique identifier assigned to each service. It is designed to be easily readable and consists only of lowercase letters, digits, and hyphens.
When a service is created, Wix Bookings automatically calculates its mainSlug
based on the service name. Any non-alphanumeric character from the service name
is replaced with a hyphen, then consecutive hyphens are removed. If the
resulting slug would be empty or a single hyphen, it's set to untitled
instead.
The following table shows some sample default slugs.
Service name | Default slug |
---|---|
My Service! Name 2023 | my-service-name-2023 |
@@@ | untitled |
A simple_test | a-simple-test |
When a service's name changes, Wix Bookings automatically updates mainSlug
,
unless the service has a custom slug. All past slugs and the current slug are
stored in service.supportedSlugs
.
You can customize a service's slug, for example for SEO purposes. Like default slugs, custom slugs may include only lowercase letters, digits, and hyphens.
You can call Set Custom Slug
(SDK | REST)
to customize a service's slug. Once you've set a custom slug, Wix Bookings
doesn't automatically update mainSlug
whenever the service name changes.
Instead, it adds a default slug based on the new service name to the
service.supportedSlugs
array.
You can check if a custom slug contains only supported characters, and isn't associated with a different service by calling Validate Slug (SDK | REST).