A WordPress site quietly loses traffic over four weeks. Search Console shows pages dropping out of the index. Someone finally checks the response headers and finds X-Robots-Tag: noindex on every URL. The plugin that sets it is rarely the obvious one — coming-soon plugins, staging-environment plugins, and security plugins all have a “discourage search engines” toggle that does exactly this. The fix is one minute. Finding the cause across a multi-plugin WordPress site takes longer.
What’s happening
There are four places a WordPress site can declare noindex: the wp-admin > Settings > Reading > "Discourage search engines" checkbox (writes blog_public = 0 to the options table), the <meta name="robots" content="noindex"> tag in the page <head>, the HTTP response header X-Robots-Tag: noindex, and per-URL settings in the active SEO plugin. Each can be set independently. The Reading setting is the most common offender on WordPress sites that were ever in staging mode — somebody flipped it on, the staging-to-production deploy copied it, and nobody re-enabled indexing.
How to verify
From any host with curl:
curl -sI https://example.com/ | grep -i x-robots
curl -sI https://example.com/some-post/ | grep -i x-robots
curl -s https://example.com/ | grep -i '<meta name="robots"'
curl -s https://example.com/robots.txt
From WP-CLI on the WordPress host:
wp option get blog_public
wp plugin list --status=active --field=name | grep -iE 'coming-soon|maintenance|seo|wpvivid|woo|staging'
wp eval 'echo get_option("blog_public") ? "indexable" : "discouraged";'
blog_public = 1 means the site allows indexing. 0 means the Reading setting is off — this single value affects both meta robots and X-Robots-Tag if the SEO plugin respects it. Yoast and Rank Math do; some custom themes don’t.
The fix
-
Check the Reading setting first. WP-CLI:
wp option update blog_public 1. Or dashboard: Settings > Reading > uncheck “Discourage search engines from indexing this site.” This single toggle clears 80% of accidental noindex on WordPress sites. -
Find header-emitting plugins. Deactivate one at a time and re-check headers. Common culprits: WP Maintenance Mode, SeedProd Coming Soon, WP Staging, Solid Security (formerly iThemes), Wordfence under “block bots” rules. Some VPN/WAF plugins set X-Robots-Tag if they detect the bot UA — verify with
curl -A "Googlebot" -sI https://example.com/. -
Theme-level noindex. Some themes (especially WooCommerce themes for checkout/cart pages) hard-code noindex on specific page types. Grep the active theme:
grep -rn "noindex" wp-content/themes/<active>/. This is correct for cart/checkout but wrong if it spans broader templates. -
Server-level noindex. Sometimes set in
.htaccess(Apache) or the Nginx vhost. On Apache:<FilesMatch "\.(html|php)$"> Header set X-Robots-Tag "noindex" </FilesMatch>This is rare in production but common on staging hosts. After cloning from staging to production, audit
.htaccessline-by-line. Stack Harbor’s enterprise WordPress hosting clone scripts strip noindex headers as part of the post-clone fixup. -
CDN/edge-level overrides. Cloudflare Transform Rules, Fastly VCL, and BunnyCDN edge rules can inject noindex. Check the edge config when the origin returns no
X-Robots-Tagbut the CDN response does.curl -sI https://example.com/ -H "Cache-Control: no-cache"to bypass edge cache if needed. -
Once noindex is removed, recovery. Use Search Console > URL Inspection > Live Test to confirm Google sees the page as indexable. Request indexing for the top 10 affected URLs to accelerate re-crawl. Full re-indexing of the WordPress site can take 2-6 weeks depending on site authority and crawl frequency.
-
Prevent regression. Add a smoke test to your deployment pipeline that runs after every deploy:
curl -sI https://example.com/ | grep -i x-robots && exit 1. If the header appears, the deploy fails. Stack Harbor’s enterprise WordPress hosting deploy pipelines include this check by default.
Stack Harbor catches accidental noindex as part of enterprise WordPress hosting deployment monitoring. Start the conversation if your WordPress traffic dropped after a deploy and you’re not sure where to look.