Question

How to add a sitemap to a Lovable app

Lovable does not generate a sitemap, but anything in the project's public folder is copied to the deployed site as-is, so you can write a sitemap.xml yourself and drop it there. It must be a real XML file listing your real routes, served from the domain's root, and you have to update it by hand when routes change. A sitemap only tells crawlers which URLs exist; it does not make your content readable, and on a Lovable app the content problem is the bigger one.

The file itself

A urlset with one <url> entry per page: <url><loc>https://your-domain.com/pricing</loc></url>. List the routes a stranger should find, not the app's internal screens. Then reference it: a Sitemap: line in your robots.txt, which you also write into the public folder, because Lovable does not generate that either.

The trap

A sitemap of routes that all serve the same empty shell is a list of pages nobody can read. The crawler follows your map, fetches each URL, and gets the same index.html with no content every time. Fix the rendering first, or the sitemap just documents the problem precisely.

Tell Google once the file is live

Submit the sitemap in Search Console and request indexing for the pages that matter. It does not speed up what Google does with the file, but it removes the discovery step, which for a brand-new domain on a builder subdomain is often the thing that never happens on its own.

The version that stays current

A hand-written sitemap goes stale the day Lovable adds a page. Connect the project to GitHub and it is an ordinary Vite repository: a build step can then generate sitemap.xml from the same route list the router uses, so adding a page adds it in both places. The full Lovable fix list is on the Lovable page.

More questions

All questions →

Scan your site

Free, no account. You get the full checklist and your score.

Only scan sites you own or are authorised to scan. Free scans are limited. Terms

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.