> ## Documentation Index
> Fetch the complete documentation index at: https://strapi-suite.littlebox.pt/llms.txt
> Use this file to discover all available pages before exploring further.

# Slug

> Give every document a clean URL. The slug field builds it from the title and keeps it unique.

A slug is the part of a URL that names a page, for example `littlebox-suite-helped-me-build-websites-faster` in
`domain.com/news/littlebox-suite-helped-me-build-websites-faster`. Clear slugs are easy to read and share, and they
help search engines understand what the page is about.

The "Littlebox Slug" field builds the slug of a document from its title. The frontend then finds the document
through the API with that slug. This page explains the field itself. To set up the slug module (the default
language in the URL, the home page and more), read the [Slug guide](https://strapi-suite.littlebox.pt/backend/guides/slug.md).

## Before you start

* Turn on internationalization (i18n) for the content type. Without it, the field shows "Activate
  internationalization to use this feature." instead of the slug.
* Turn on the slug module in the *Littlebox Strapi Suite*. While the module is off, the field stays hidden.
* Add a "Text" field called `title` to the content type. The slug follows this field.

## Create the field

**Step 1**: Access the Strapi admin panel.\
**Step 2**: Go to the *Content-Type Builder*.\
**Step 3**: Select the collection type or single type that the frontend shows as a page.\
**Step 4**: Click "Add another field".\
**Step 5**: Go to the *Custom* tab.\
**Step 6**: Select "Littlebox Slug".\
**Step 7**: In the basic settings, type a name for the field, for example `slug`, and set "Attached field" to
"Title". The field needs an attached field.

![](https://mintcdn.com/littlebox/-V-36Cf2XSVdHw_h/images/slug-add-component-step-2.png?fit=max\&auto=format\&n=-V-36Cf2XSVdHw_h\&q=85\&s=ebb86590381a82856ab0c297a9679180)

**Step 8**: In the advanced settings, check "Enable localization for this field", so every language has its own slug.

![](https://mintcdn.com/littlebox/-V-36Cf2XSVdHw_h/images/slug-add-component-step-3.png?fit=max\&auto=format\&n=-V-36Cf2XSVdHw_h\&q=85\&s=0e29f3636b2a2be5a153236a017f5377)

**Step 9**: Click "Finish", then click "Save".

## How the field works

In the Content Manager, the field shows the full path of the page: the language, the parent page and the slug.

![](https://mintcdn.com/littlebox/7czXCWihyCQwyusF/images/backend-custom-fields-slug-follows-title.png?fit=max\&auto=format\&n=7czXCWihyCQwyusF\&q=85\&s=96db7108a0bebebc7ed21222f83122ab)

**It follows the title.** In a new document, the slug changes as you type the title. When you save the document for
the first time, the slug stops following the title, so later title changes don't break links that people already
shared.

**Attach it again.** To make the slug follow the title again, click the pin button next to "Edit". The slug updates
right away.

**Edit it by hand.** Click "Edit" and type the slug you want. Editing stops the link to the title. Click the
<kbd>×</kbd> button to cancel and go back to the previous slug.

![](https://mintcdn.com/littlebox/7czXCWihyCQwyusF/images/backend-custom-fields-slug-edit.png?fit=max\&auto=format\&n=7czXCWihyCQwyusF\&q=85\&s=d24061750da8e7ac82703ed3d0a62141)

### The prefix

The gray text before the slug shows the start of the URL:

* **The language**, for example `/pt/`. The default language shows only when "Show language slug" is on in the
  [slug settings](https://strapi-suite.littlebox.pt/backend/guides/slug.md#settings).
* **The parent page**, when the document has one in its [page attributes](https://strapi-suite.littlebox.pt/backend/guides/page-attributes.md). For
  example, an article under "News" gets `/news/` before its slug.

### Slug rules

Strapi cleans what you type, so every slug is safe to use in a URL:

| Rule | Example |
| - | - |
| Lowercase letters only | `Summer Sale` → `summer-sale` |
| Accents removed | `Coração` → `coracao` |
| Spaces and symbols become a hyphen | `Shoes & Bags!` → `shoes-bags` |
| No repeated hyphens, none at the start or the end | `--new---arrivals--` → `new-arrivals` |
| Up to 100 characters | Longer slugs are cut at 100. |

### Unique slugs

Two documents can't share the same slug under the same parent page in the same language. If you save a slug that
is already in use, Strapi adds a number at the end to keep it unique, for example `summer-sale-1764238500000`.
Change it by hand if you prefer a cleaner slug.

The same slug can exist in different languages or under different parent pages, because the full URL is still
different. For example, `/news/launch` and `/blog/launch` can both exist.

## API

Strapi keeps the slug in the slug module, not in the field. Find a document by its slug with the pages endpoint:

```bash theme={null}
curl -X GET "/api/littlebox-strapi-suite/modules/pages?slug=news/littlebox-suite-helped-me-build-websites-faster"
```

The answer includes the full slug of the document and of its translations. Read the [Slug guide](https://strapi-suite.littlebox.pt/backend/guides/slug.md#api)
for the full answer and the other endpoints.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.