brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: Search engine visibility in WordPress asks Google to skip a site, and that's all it does

WordPress
~/tips/tip-wordpress-search-engine-visibility

wp option get blog_public

Asks search engines not to index a WordPress site, without blocking anyone from visiting it.

Every staging site, test install and half-built project should stay out of search results. WordPress has a checkbox for that, and it does less than its name suggests, which is worth knowing before you rely on it.

Go to Settings → Reading and tick “Discourage search engines from indexing this site” under Search engine visibility. WordPress stores that as the option blog_public, set to 0. You can check and change it from the command line too, which is handy when you clone a site:

wp option get blog_public
wp option update blog_public 0

With blog_public at 0, WordPress adds a robots meta tag with noindex, nofollow to the head of every page (since 5.7 through the wp_robots filter), and it stops pinging update services, which the Settings → Writing screen then tells you about. To see it on a live page, run curl -s https://staging.example.com | grep robots and look for the noindex.

The WordPress documentation is blunt about the limit: this doesn’t block access to your site, and it’s up to search engines to honour the request. Well-behaved crawlers do. Anything else can still read every page. For a staging site with real customer data or unreleased work, I’d put something in front that actually refuses visitors, like HTTP basic auth on the proxy, or keep it reachable only over Tailscale.

The reverse mistake is just as common. When a site goes live, the box is still ticked and the new site never shows up in Google. My advice: add wp option get blog_public to your launch checklist and make sure it says 1.

Further reading: Settings Reading Screen (WordPress documentation), wp_robots_no_robots()

More WordPress tips wp user application-password create anna backup-script --porcelain define( 'MEDIA_TRASH', true ); wp cli check-update wp theme delete --all wp media image-size All WordPress tips (85) All topics

Link