Skip to content

fix: stop dev from being indexed by search engines - #493

Merged
saqibmanan merged 2 commits into
devfrom
fix/dev-noindex
Oct 7, 2026
Merged

saqibmanan merged 2 commits into
devfrom
fix/dev-noindex

Conversation

@saqibmanan

@saqibmanan saqibmanan commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Problem

dev.civicdataspace.in serves a full sitemap and is being indexed. FEATURE_SITEMAPS is false on dev, but isSitemapEnabled() also returned true when NODE_ENV === 'production', which is the case for every deployed build.

Changes

  • isSitemapEnabled() now depends only on FEATURE_SITEMAPS === 'true'.
  • When sitemaps are disabled, every response carries X-Robots-Tag: noindex, nofollow so already-indexed dev pages get dropped. robots.txt stays Allow so crawlers can see the header.

Prod impact: none

Prod has FEATURE_SITEMAPS='true' both in the production GitHub environment (build) and in shared/.env.local on the server (runtime), so prod keeps its sitemap and gets no noindex header.

Verified (local next build + next start)

env X-Robots-Tag robots.txt Sitemap line /sitemap.xml
FEATURE_SITEMAPS='true' (prod-like) absent present 200
FEATURE_SITEMAPS='false' (dev-like) noindex, nofollow absent 404

After merge

Request removal of dev.civicdataspace.in in Google Search Console to speed up de-indexing.

Fixes #494

NODE_ENV is 'production' on every deployed build, so dev served
sitemaps despite FEATURE_SITEMAPS=false.
Keeps dev out of search indexes and lets crawlers drop already-indexed pages.

This branch was successfully deployed

1 active deployment
development — d8b9a88c Deployed Oct 7, 2026 by saqibmanan via build (24.x) #837
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant