Skip to main content
RapidDev - Software Development Agency
bubble-tutorial

How to generate unique URLs in Bubble

Generate unique, SEO-friendly URLs in Bubble using the 'Set a thing's slug' action. Slugs are human-readable identifiers (e.g., my-product-name) appended to dynamic page URLs. Auto-generate slugs from titles by converting to lowercase, replacing spaces with hyphens, and removing special characters. Check for uniqueness by searching existing slugs before saving.

What you'll learn

  • How to use Bubble's built-in slug system for clean URLs
  • How to auto-generate slugs from content titles
  • How to ensure slug uniqueness across records
  • How to configure dynamic pages to use slugs
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Beginner5 min read10-15 minAll Bubble plansMarch 2026RapidDev Engineering Team
TL;DR

Generate unique, SEO-friendly URLs in Bubble using the 'Set a thing's slug' action. Slugs are human-readable identifiers (e.g., my-product-name) appended to dynamic page URLs. Auto-generate slugs from titles by converting to lowercase, replacing spaces with hyphens, and removing special characters. Check for uniqueness by searching existing slugs before saving.

Generate Unique URLs with Slugs in Bubble

This tutorial shows you how to create clean, human-readable URLs for your Bubble app pages using slugs. Instead of long unique IDs, your URLs will look like yourapp.com/product/blue-running-shoes.

Prerequisites

  • A Bubble account with an active app
  • A Data Type with content that needs unique URLs
  • Basic understanding of dynamic pages

Step-by-step guide

1

Set Up a Dynamic Page with Type of Content

Create a page (e.g., 'product') and set its Type of content to your Data Type (Product). This enables the URL pattern: yourapp.com/product/[slug]. When users visit this URL, Bubble loads the Product matching the slug automatically into 'Current Page Product'.

Expected result: A dynamic page that loads data based on the URL slug.

2

Generate Slugs from Titles

In the workflow where you create a new record, after the 'Create a new thing' action, add the 'Set a thing's slug' action (found under Data Things). Set the thing to 'Result of step 1' and the slug to a formatted version of the title: 'Result of step 1's name :lowercase :find & replace (regex pattern for spaces and special chars)'. A simpler approach: just pass the title directly — Bubble auto-formats slugs to be URL-safe.

Pro tip: Bubble's 'Set a thing's slug' action automatically converts text to URL-safe format (lowercase, hyphens for spaces). You do not need to manually sanitize in most cases.

Expected result: Each new record gets a clean, URL-safe slug derived from its title.

3

Ensure Slug Uniqueness

Before setting the slug, check if it already exists: Search for Products where slug = generated_slug. If the count is greater than 0, append a number (e.g., 'blue-shoes-2'). Implement this in a backend workflow that tries the base slug, checks uniqueness, and appends an incrementing number until unique. Save the final slug using 'Set a thing's slug'.

Expected result: Every slug is unique, preventing URL collisions.

4

Link to Dynamic Pages Using Slugs

When creating links to dynamic pages, use the 'Go to page' action with 'Data to send' = the record. Bubble automatically constructs the URL with the slug. In Link elements, set destination to the dynamic page and data to the record. The resulting URL will be: yourapp.com/product/record-slug.

Expected result: Navigation links generate clean URLs using slugs.

5

Handle Missing or Changed Slugs

If a slug changes (e.g., title is edited), old URLs break. Consider: (1) Never change slugs after creation. (2) Store old slugs in a 'slug_history' list field and add a redirect mechanism. (3) On the page, if no data is found for the slug, redirect to a 404 page. Add a 'Page is loaded' condition: if Current Page Product is empty → Go to 404 page.

Expected result: Old URLs are handled gracefully with redirects or 404 pages.

Complete working example

Workflow summary
1SLUG GENERATION WORKFLOW:
2
31. Create Product (name, description, price, etc.)
42. Generate base slug from name:
5 base_slug = Result of step 1's name (Bubble auto-formats)
63. Check uniqueness:
7 Search for Products (slug = base_slug):count
84. If count > 0:
9 Append number: base_slug & "-" & (count + 1)
105. Set a thing's slug:
11 Thing: Result of step 1
12 Slug: final unique slug
13
14URL STRUCTURE:
15yourapp.com/product/blue-running-shoes
16yourapp.com/blog/how-to-build-an-app
17yourapp.com/profile/john-doe
18
19PAGE CONFIGURATION:
20- Page: product
21- Type of content: Product
22- Current Page Product = loaded by slug match
23
24404 HANDLING:
25- Page is loaded Only when Current Page Product is empty:
26 Go to page: 404

Common mistakes when generating unique URLs in Bubble

Why it's a problem: Using 'Make changes to a thing' to set slugs

How to avoid: Always use the 'Set a thing's slug' workflow action, not a custom text field.

Why it's a problem: Not checking for slug uniqueness

How to avoid: Search for existing records with the same slug before setting it. Append a number if a collision exists.

Why it's a problem: Changing slugs when titles are edited

How to avoid: Set slugs once at creation time and never change them, even if the title changes.

Best practices

  • Use the 'Set a thing's slug' action, not a custom text field.
  • Set slugs at record creation time and never change them.
  • Check for uniqueness before setting a slug.
  • Keep slugs short and descriptive — under 50 characters.
  • Handle 404 cases when a slug does not match any record.
  • Include slugs in your XML sitemap for SEO.

Still stuck?

Copy one of these prompts to get a personalized, step-by-step explanation.

ChatGPT Prompt

I want clean URLs in my Bubble.io app like /product/blue-running-shoes instead of /product/1234567890. How do I set up slugs, auto-generate them from product names, and ensure uniqueness?

Bubble Prompt

Set up slug generation for the Product data type. Auto-generate slugs from product names on creation. Check for uniqueness and append numbers if needed. Configure the product page to use slugs.

Frequently asked questions

Can I customize the slug format?

Bubble auto-formats slugs (lowercase, hyphens). You can pre-process the text before passing it to 'Set a thing's slug' if you want additional formatting, like removing common words.

What characters are allowed in slugs?

Slugs support lowercase letters, numbers, and hyphens. Bubble automatically strips or converts other characters.

Can I use slugs on the free plan?

Yes. Slugs and dynamic pages work on all Bubble plans.

How do I redirect old slugs to new ones?

Store old slugs in a list field. On page load, if the current slug does not match but is in the history list, redirect to the correct URL. For complex URL management, RapidDev can implement proper redirect systems.

Do slugs affect SEO?

Yes. Clean, descriptive URLs are a minor SEO ranking factor. 'yourapp.com/product/blue-running-shoes' is better than 'yourapp.com/product/1609123456789x123456789'.

Can two different Data Types have the same slug?

Yes. Slugs are unique per Data Type. A Product and a BlogPost can both have the slug 'best-picks-2026' because they are on different pages.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.