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

How to add a sitemap in Bubble

Bubble does not generate sitemaps automatically, but you can create one using a backend API workflow that outputs XML, or by manually hosting a sitemap.xml file via an API endpoint. This tutorial covers generating a sitemap that includes both static pages and dynamic content pages, then submitting it to Google Search Console.

What you'll learn

  • How to create a sitemap XML structure for your Bubble app
  • How to expose a sitemap via a backend API workflow endpoint
  • How to include dynamic pages in your sitemap automatically
  • How to submit your sitemap to Google Search Console
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Beginner5 min read15-20 minStarter plan+ (backend workflows required)March 2026RapidDev Engineering Team
TL;DR

Bubble does not generate sitemaps automatically, but you can create one using a backend API workflow that outputs XML, or by manually hosting a sitemap.xml file via an API endpoint. This tutorial covers generating a sitemap that includes both static pages and dynamic content pages, then submitting it to Google Search Console.

Overview: Adding a Sitemap to Your Bubble App

A sitemap tells search engines which pages exist on your site and how often they change. Bubble does not generate sitemaps automatically, so you need to build one. This tutorial shows you how to create a dynamic sitemap that includes your static pages and database-driven dynamic pages.

Prerequisites

  • A Bubble app deployed to a custom domain (recommended for SEO)
  • Backend workflows enabled (Starter plan or above)
  • A Google Search Console account
  • Basic understanding of XML structure

Step-by-step guide

1

Create a backend API workflow that returns XML

Go to the Workflow tab → Backend workflows. Create a new API workflow called sitemap. Check Expose as a public API workflow. In the workflow, the goal is to return XML content. Since Bubble backend workflows return JSON by default, you will need a workaround: create a page that generates the XML and is accessible at a known URL, or use the Return data from API action to return the sitemap content as text.

Expected result: A backend API workflow accessible at a public URL that can return sitemap content.

2

Build the sitemap XML content

Your sitemap needs to follow the standard XML sitemap protocol. List all your static pages (home, about, pricing, contact, blog) with their full URLs. For dynamic pages (blog posts, product pages), use a Do a Search to find all published records and generate a URL for each one using their slug. Format each entry with the loc, lastmod, changefreq, and priority tags.

sitemap.xml structure
1<?xml version="1.0" encoding="UTF-8"?>
2<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3 <url>
4 <loc>https://yourdomain.com</loc>
5 <changefreq>weekly</changefreq>
6 <priority>1.0</priority>
7 </url>
8 <url>
9 <loc>https://yourdomain.com/blog</loc>
10 <changefreq>daily</changefreq>
11 <priority>0.8</priority>
12 </url>
13 <url>
14 <loc>https://yourdomain.com/blog-post/my-first-post</loc>
15 <lastmod>2026-03-15</lastmod>
16 <changefreq>monthly</changefreq>
17 <priority>0.6</priority>
18 </url>
19</urlset>

Pro tip: For a simpler approach, create a dedicated Bubble page that generates the sitemap XML using an HTML element with the XML content, then point Google Search Console to that page URL.

Expected result: A complete sitemap XML with all static and dynamic page URLs.

3

Create a sitemap page as an alternative approach

A simpler method: create a Bubble page called sitemap-xml. Add a single HTML element that contains your sitemap XML. For dynamic content, use Bubble's dynamic expressions to generate URL entries. Build the XML string using a Repeating Group's items or Text element with dynamic data. Access this page at https://yourdomain.com/sitemap-xml.

Expected result: A Bubble page at /sitemap-xml that displays your sitemap content.

4

Submit the sitemap to Google Search Console

Go to search.google.com/search-console. Select your property (domain). Navigate to Sitemaps in the left sidebar. Enter your sitemap URL (e.g., https://yourdomain.com/sitemap-xml or the API endpoint URL). Click Submit. Google will fetch and process your sitemap. Check back in a few days to see the indexing status and any errors.

Expected result: Google Search Console accepts your sitemap and begins crawling your pages.

5

Add the sitemap reference to robots.txt

Go to Settings in Bubble. In the SEO / metatags section, find the robots.txt field. Add a line: Sitemap: https://yourdomain.com/sitemap-xml. This tells all search engine crawlers where to find your sitemap without requiring manual submission to each engine.

Expected result: Your robots.txt file references the sitemap URL for automatic discovery by search engines.

Complete working example

Workflow summary
1SITEMAP SETUP SUMMARY
2======================
3
4APPROACH 1: Sitemap Page
5 Page: sitemap-xml
6 HTML Element content (dynamic):
7 <?xml version="1.0" encoding="UTF-8"?>
8 <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
9 <url><loc>https://domain.com</loc><priority>1.0</priority></url>
10 <url><loc>https://domain.com/blog</loc><priority>0.8</priority></url>
11 [For each published Post:]
12 <url>
13 <loc>https://domain.com/blog-post/[Post's slug]</loc>
14 <lastmod>[Post's Modified Date:formatted as YYYY-MM-DD]</lastmod>
15 <priority>0.6</priority>
16 </url>
17 </urlset>
18
19APPROACH 2: Backend API Workflow
20 Workflow: sitemap (exposed as public API)
21 Return data: XML string generated with dynamic content
22 URL: https://app.bubbleapps.io/api/1.1/wf/sitemap
23
24ROBOTS.TXT (Settings SEO/metatags):
25 User-agent: *
26 Allow: /
27 Sitemap: https://yourdomain.com/sitemap-xml
28
29GOOGLE SEARCH CONSOLE:
30 1. Add property for your domain
31 2. Verify ownership
32 3. Sitemaps Add sitemap URL
33 4. Monitor indexing status
34
35STATIC PAGES TO INCLUDE:
36 / (home) priority 1.0
37 /about priority 0.7
38 /pricing priority 0.8
39 /blog priority 0.8
40 /contact priority 0.5
41
42DYNAMIC PAGES TO INCLUDE:
43 /blog-post/[slug] Search all Posts where published=yes
44 /product/[slug] Search all Products where active=yes

Common mistakes when adding a sitemap in Bubble

Why it's a problem: Forgetting to include dynamic pages in the sitemap

How to avoid: Query your database for all published dynamic content and generate a URL entry for each record

Why it's a problem: Not updating the sitemap when new content is published

How to avoid: Use dynamic expressions so the sitemap page automatically includes new records when they are published

Why it's a problem: Using incorrect URL formats in the sitemap

How to avoid: Always use full absolute URLs starting with https:// and use your custom domain, not the bubbleapps.io subdomain

Best practices

  • Include both static pages and dynamic content pages in your sitemap
  • Use your custom domain in sitemap URLs, not the bubbleapps.io subdomain
  • Add lastmod dates for content that changes, using the record's Modified Date
  • Reference your sitemap in robots.txt for automatic crawler discovery
  • Resubmit the sitemap in Google Search Console after major content additions
  • Keep sitemaps under 50,000 URLs and 50MB — split into multiple sitemaps if needed

Still stuck?

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

ChatGPT Prompt

I need to create an XML sitemap for my Bubble.io app that includes both static pages and dynamic blog posts. The sitemap should auto-update when new posts are published. Can you walk me through creating a sitemap page and submitting it to Google Search Console?

Bubble Prompt

Create a sitemap for my app. I have static pages (home, about, pricing, blog) and dynamic blog posts. The sitemap should automatically include new posts when they are published. Also add the sitemap reference to my robots.txt.

Frequently asked questions

Does Bubble generate a sitemap automatically?

No. Bubble does not have built-in sitemap generation. You need to create one manually using a page, API workflow, or a plugin.

Do I need a custom domain for SEO?

A custom domain is strongly recommended. Google treats bubbleapps.io subdomains as part of a shared domain, which can limit your SEO authority.

How often does Google re-crawl my sitemap?

Google crawls sitemaps on its own schedule, typically every few days to weeks. You can request re-crawling in Google Search Console after major updates.

Can I have multiple sitemaps?

Yes. Use a sitemap index file that references multiple sitemaps. This is useful if you have separate sitemaps for blog posts, products, and static pages.

Will a sitemap guarantee my pages get indexed?

No. A sitemap is a suggestion to search engines, not a guarantee. Pages still need quality content, proper meta tags, and no indexing blocks to be indexed.

Can RapidDev help with comprehensive SEO for my Bubble app?

Yes. RapidDev can help with technical SEO including sitemaps, structured data, meta tags, page speed optimization, and content strategy for Bubble apps.

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.