Replit app not indexed by Google? How to fix it
Short answer
- Check robots.txt and sitemap.xml first: in many SPAs they return index.html, so Google cannot read them.
- A client-rendered React app sends the same empty HTML and title for every URL. Give each page its own title, description and content in the HTML.
- Pick one domain as canonical and redirect the other (.replit.app or www) to it.
Weeks after launch, a search for your product finds nothing, and Search Console says Discovered – currently not indexed or Sitemap could not be read. Replit itself does not block Google. The usual causes are in the app: the way Agent sets up a single-page React app makes every URL look like the same empty page. Here is the checklist we run in every audit.
Symptoms
site:yourdomain.comin Google shows nothing, or only the homepage.- Search Console reports the sitemap as HTML or unreadable.
- Every page in search results shows the same title and description.
- Pages are indexed under the
.replit.appdomain instead of your own. - Search Console shows Soft 404 or Duplicate without user-selected canonical.
Likely causes
- The SPA fallback serves
index.htmlfor/robots.txtand/sitemap.xml. - No sitemap, or a sitemap listing URLs that redirect or 404.
- Pages render only in JavaScript, with one shared title and no text in the initial HTML.
- Both
.replit.appand the custom domain serve the same pages, with no canonical. - Missing pages return 200 with the app shell, which Google treats as soft 404s.
- A leftover
noindextag or a private deployment.
Step-by-step fix
1. Test robots.txt and sitemap.xml
curl -sI https://yourdomain.com/robots.txt # expect content-type: text/plain
curl -sI https://yourdomain.com/sitemap.xml # expect application/xml or text/xml
curl -s https://yourdomain.com/robots.txt # should NOT start with <!doctype html>If they return HTML, serve them as real files before the SPA fallback (see SPA routing on Replit). robots.txt should allow crawling and link to the sitemap.
2. Give every page its own head
Each public page needs a unique <title>, meta description and canonical URL. In React, react-helmet-async sets them per route. For pages you want to rank (home, pricing, features, articles), the content should also be in the HTML the server sends: prerender those routes at build time or render them on the server.
3. Choose one canonical domain
Add <link rel="canonical" href="https://yourdomain.com/page"> on every page, and redirect other hosts with a 301.
app.use((req, res, next) => {
if (req.hostname.endsWith(".replit.app")) {
return res.redirect(301, `https://yourdomain.com${req.originalUrl}`);
}
next();
});
4. Return real 404s
Unknown URLs should return status 404, not 200 with the app shell. Keep a list of valid routes on the server, or return 404 from the fallback for paths your router does not know.
5. Submit and request indexing
Verify the domain in Google Search Console, submit the sitemap, and use URL Inspection on your key pages. Indexing can take days to weeks after the fixes.
Copy-paste prompt for Replit Agent
Open a new Agent chat (a fresh chat keeps old attempts out of its context) and paste this:
My Replit app is not indexed by Google. Please fix technical SEO without changing the design:
1. Make /robots.txt (allow all, with a Sitemap: line) and /sitemap.xml real files served before the SPA fallback, with correct content types.
2. Generate sitemap.xml at build time from the public routes, with absolute URLs on https://yourdomain.com.
3. Add per-route title, meta description, canonical and Open Graph tags (react-helmet-async or equivalent).
4. Prerender the public marketing pages at build time so their text is in the initial HTML.
5. 301-redirect *.replit.app requests to https://yourdomain.com and return a real 404 status for unknown paths.
Remove any noindex tags on public pages.How to verify the fix
curl -s https://yourdomain.com/pricing | grep -i '<title>'shows the pricing page's own title.- robots.txt is plain text and sitemap.xml is XML, both with status 200.
curl -sI https://yourapp.replit.app/returns a 301 to your domain.- Search Console's URL Inspection shows the page as indexable, and the sitemap as read successfully.
robots.txt, sitemap, titles and soft 404s are part of what the free audit checks on your live app.
FAQ
Does Replit block Google from indexing my app?
No, a public Replit deployment can be indexed. Problems usually come from the app: robots.txt or the sitemap returning HTML, client-only rendering, duplicate domains or soft 404s. A private deployment cannot be crawled.
Why does my sitemap.xml return HTML?
The single-page app fallback answers every unknown path with index.html. Serve sitemap.xml and robots.txt as real files before the fallback.
Should I keep my .replit.app URL indexed?
Pick one canonical domain, usually your custom domain, and 301-redirect the .replit.app URL to it so Google does not see two copies of every page.