
A WordPress plugin that automatically controls search engine indexing based on your environment (production vs development/staging).
This plugin prevents accidental search engine indexing of development, staging, or testing WordPress sites by automatically enforcing the “Discourage search engines from indexing this site” option when not in a production environment.
Method 1: WP_ENV Constant (Recommended)
Add this to your wp-config.php:
// For production
define('WP_ENV', 'production');
// For development/staging
define('WP_ENV', 'development');
// or
define('WP_ENV', 'staging');
Method 2: URL Comparison
If WP_ENV is not defined, the plugin compares:
* Current site URL: home_url(‘/’)
* Configured production URL (from plugin settings)