Sitemap
How to add a sitemap.xml to a Lovable site (and submit it to Google)
If your Lovable site has no sitemap.xml, add one, point robots.txt at it, and submit it in Search Console.
The short answer
Open your published site at https://yourdomain/sitemap.xml. If that address 404s, the sitemap is not there yet.
Run Lovable's SEO and AI search review and use Add a sitemap or Try to fix, or ask in the project chat. Publish the site.
Add a Sitemap: line to robots.txt, then submit the sitemap in Google Search Console.
Check what you have now
Visit https://yourdomain/sitemap.xml and https://yourdomain/robots.txt on the host you want in Google.
Lovable's SEO and AI search docs say Lovable creates a robots.txt with every new project, but not always a sitemap, and the starting metadata is generic.
The review's sitemap finding fails when the sitemap is missing, is not valid XML, lists placeholder routes or relative URLs, or points at another host. Lovable shows that as Add a sitemap or Sitemap needs attention. Another host includes a lovable.app address in the file while the site people visit is on your custom domain.
The robots.txt finding fails when the file is missing, blocks crawlers, or has a missing or wrong Sitemap: line. robots.txt explained for beginners is a short tour of that file.
Fix it in Lovable
The review is on the SEO & AI tab of Analytics. Open More, then Analytics, and select SEO & AI. It checks your sitemap, robots.txt, metadata, structured data, canonical tags, indexing, and AI readiness. Running the review is included. Try to fix applies the changes, and normal Lovable usage costs apply.
Click Try to fix on Add a sitemap or Sitemap needs attention. If the robots.txt finding is failing too, fix that so the file has a correct Sitemap: line. Then publish.
You can also ask in chat. This is an example prompt, not a required command. Replace example.com with your custom domain:
Example
Create sitemap.xml at the site root. List every public route with absolute URLs on my custom domain, https://example.com. Do not use relative URLs, placeholder routes, or a lovable.app host. Add a Sitemap: line to robots.txt that points at https://example.com/sitemap.xml.
Publish after Lovable writes the files. Lovable's docs say Google reads the sitemap from your live site, so pages that exist only in unpublished code are not included.
Apps created from May 13, 2026 use TanStack Start with server-side rendering, and older React + Vite apps are pre-rendered for verified crawlers when they request a page. See Lovable, v0, and Bolt pages that Google never sees. If the page looks finished in the browser and thin in the HTML, see Is my Lovable, Bolt, or v0 site visible to Google?.
An example sitemap
This is an example, not a file to upload as-is. Google's sitemap docs say the file must be UTF-8, that one sitemap is at most 50MB uncompressed or 50,000 URLs, and that the site root is the recommended place. Use fully qualified absolute URLs. Google will try to crawl each URL exactly as it is written, so /about is not enough.
Example
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/</loc>
</url>
<url>
<loc>https://example.com/about</loc>
</url>
</urlset>This is an example Sitemap: line for robots.txt. Google says you can add that line anywhere in the file, and that it will look for it the next time it crawls robots.txt:
Example
Sitemap: https://example.com/sitemap.xml
Submit it to Google
Connect a custom domain first. Lovable's docs say only publicly published apps can appear in search. Unpublished projects, projects with restricted website access, and branded workspace URLs ({app-name}.{workspace-subdomain}.lovable.app) never appear in search. Connect a custom domain to build search presence, then run the review again so Lovable can verify the new domain in Google Search Console.
Submit the sitemap in the Search Console Sitemaps report, or keep the Sitemap: line in robots.txt. Google documents both.
With Lovable's Google Search Console connector linked, Try to fix on the Google Search Console finding verifies the site with a meta tag in the HTML. You do not change DNS records. It then submits the sitemap. Publish first, because Google reads the sitemap from the live site. The connector can verify the domain, submit sitemaps, and read sitemap status, including warnings, errors, and indexed counts.
If Search Console says Couldn't fetch, start with Sitemap says "Couldn't fetch" in Search Console.
A sitemap does not get the page indexed
A sitemap helps Google find pages. It does not make Google index them. Google's sitemap docs say submitting a sitemap is a hint: it does not guarantee that Google will download the sitemap or use it to crawl the URLs on the site.
Two common next statuses, after Google knows the URL, are Discovered - currently not indexed and Crawled - currently not indexed. How to check if Google can index my page is a public check of the page itself, separate from the sitemap.
Run the free check
Paste your published Lovable page into the free check. It is free, no sign-up.
The check fetches that URL with a browser user agent, follows redirects, and then fetches the final URL as Googlebot, GPTBot, and ClaudeBot. Those requests come from IndexDoctor's server. It reads robots.txt with the Googlebot user agent. On the browser response it checks the noindex robots meta tag, a googlebot meta tag when one is present, the X-Robots-Tag header, and the canonical link against the final URL.
It also reads a sitemap. When robots.txt lists Sitemap: URLs, it fetches those. When it lists none, it fetches /sitemap.xml on that host. The sitemap request uses the browser user agent and stops after four files. It reports whether the URL you pasted is listed. It can also report that no sitemap was fetched, that the HTTP status was an error, or that the body was HTML or not a urlset or sitemap index. It does not submit the sitemap to Google.
FAQ
Will a branded lovable.app address show up in Google?
No. Lovable says branded workspace URLs never appear in search. Unpublished projects and projects with restricted website access do not either. Connect a custom domain, publish, then run the review again.
Does Try to fix change my DNS?
No. Lovable verifies the site with a meta tag in the HTML. You do not change DNS records. Publish first. Google reads the sitemap from the live site.
Related
- Is my Lovable, Bolt, or v0 site visible to Google?
- Lovable, v0, and Bolt pages that Google never sees
- Sitemap says "Couldn't fetch" in Search Console
- robots.txt explained for beginners
- How to check if Google can index my page
- Discovered - currently not indexed
- Crawled - currently not indexed
Sources
- Lovable, Optimize your app for SEO and AI search: https://docs.lovable.dev/features/seo-aeo
- Lovable, Connect your app to Google Search Console: https://docs.lovable.dev/integrations/google-search-console
- Google, Build and submit a sitemap: https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap