After adding a URL field, you can define how entry URLs are generated using a URL pattern.
A URL pattern determines the structure of your URLs by combining static text and dynamic values (tokens). These values are replaced with actual entry data when the URL is generated.
Note: URL pattern configuration and advanced formatting options are available only with URL Management V2. Contact our support team to enable this feature.
You can define URL patterns using a combination of:
Enter a pattern manually or select supported values from the dropdown.
Example: /blog/:locale/:field[title]
This generates URLs such as:
// blog/:locale/:field[title]
www.examplesite.com/blog/en-us/my-first-pageTo add and configure a URL field, log in to your Contentstack account and perform the following steps:
Tip: You can also click the vertical ellipsis icon in the Actions column next to the content type and select Edit.
Note:
You can include the following values in your URL pattern:
| Type | Description |
|---|---|
| Title, date, month, year | System-generated entry values |
| Locale code | Adds locale code (for example, en-us) |
| Locale full name | Adds locale name (for example, English (US)) |
| Field values | Uses values from supported text fields |
| Taxonomy | Uses taxonomy values in the URL |
Note: Only single-value text fields (such as Single Line Textbox or Multi Line Textbox) can be used. Multiple-value fields are not supported.
| Pattern | Generated URL |
|---|---|
| /blog/:field[title] | /blog/my-first-page |
| /:locale/:field[title] | /en-us/my-first-page |
| /shop/:taxonomy[category]/:field[title] | /shop/electronics/my-first-page |
You can control how URL values are formatted using advanced settings.
Available options include:
These settings help ensure URLs follow your organization’s standards. URL formatting is applied in the following order: default value, casing, word separator, JSON mapping, and regex rules.
You can edit or modify the URL when creating or editing an entry.
Depending on your configuration:
If auto-generation is disabled, the URL field remains empty, allowing you to enter a custom URL manually.
Using default URL patterns helps you generate consistent and structured URLs across your entries. With the ability to customize patterns, control formatting, and override URLs when needed, you can ensure your URLs remain clean, readable, and optimized for your application’s requirements.