Title: Envwise Environment-Based Control
Author: David Tavares
Published: <strong>2026 年 11 月 12 日</strong>
Last modified: 2026 年 11 月 12 日

---

搜尋外掛

![](https://ps.w.org/envwise/assets/banner-772x250.png?rev=3798567)

![](https://ps.w.org/envwise/assets/icon-256x256.png?rev=3798567)

# Envwise Environment-Based Control

 由 [David Tavares](https://profiles.wordpress.org/davet86/) 開發

[下載](https://downloads.wordpress.org/plugin/envwise.1.1.0.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/envwise/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/envwise/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/envwise/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/envwise/#developers)

 [技術支援](https://wordpress.org/support/plugin/envwise/)

## 外掛說明

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.

#### Features

 * **Automatic Environment Detection**: Detects production vs non-production environments
   using two methods:
    - WP_ENV constant (takes priority if defined)
    - URL comparison between current site and configured production URL
 * **Automatic Privacy Control**: Forces search engine discouragement on non-production
   environments
 * **Production Override**: Allows search engine indexing only on production sites
 * **Admin Dashboard**: Provides a clear status overview and configuration interface
 * **Production URL Setting**: Define your production site URL for environment comparison
 * **Plugin Deactivation Behavior**: Choose whether to restore search engine indexing
   when the plugin is deactivated
 * **Status Dashboard**: Real-time environment status display under Tools menu
 * **Visual Indicators**: Clear production/non-production status with color-coded
   indicators
 * **Settings Integration**: Direct settings link from the plugins page
 * **Admin Notices**: Warning notifications when running on non-production environments

#### Safety Features

 * **Database Protection**: Automatically updates the blog_public option based on
   environment
 * **Activation/Deactivation Hooks**: Properly handles plugin lifecycle events
 * **Backward Compatibility**: Maintains compatibility with existing installations

#### Use Cases

 * **Development Sites**: Prevent accidental indexing of localhost or development
   domains
 * **Staging Sites**: Protect staging environments from search engines
 * **Multi-Environment Workflows**: Seamlessly deploy across different environments
 * **Client Sites**: Ensure development work doesn’t appear in search results

### Configuration

#### Setting Up Production URL

 1. Navigate to Tools > Envwise
 2. Enter your production site URL (e.g., https://www.yoursite.com/)
 3. Configure plugin deactivation behavior
 4. Save settings

#### Environment Detection Methods

**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)

## 安裝方式

 1. Upload the plugin files to the `/wp-content/plugins/envwise/` directory, or install
    the plugin through the WordPress plugins screen directly.
 2. Activate the plugin through the ‘Plugins’ screen in WordPress.
 3. Use the Tools > Envwise screen to configure the plugin.

## 常見問題集

### How does the plugin detect environments?

The plugin uses two methods:
 1. WP_ENV constant (recommended) – if defined in wp-
config.php 2. URL comparison between current site and configured production URL

### What environments are supported?

The plugin recognizes ‘production’ as the production environment. Any other value(
development, staging, local, etc.) is treated as non-production.

### Can I use this plugin on multisite?

Currently, the plugin is designed for single-site installations. Multisite support
is planned for future releases.

### What happens when I deactivate the plugin?

By default the plugin restores search engine indexing when deactivated. If you turn
off “Plugin Disabled Behavior” in the plugin configuration, the indexing setting
for the current environment is saved instead (non-production sites stay discouraged).

## 使用者評論

這個外掛目前沒有任何使用者評論。

## 參與者及開發者

以下人員參與了開源軟體〈Envwise Environment-Based Control〉的開發相關工作。

參與者

 *   [ David Tavares ](https://profiles.wordpress.org/davet86/)
 *   [ Alkesh Miyani ](https://profiles.wordpress.org/alkesh7/)

[將〈Envwise Environment-Based Control〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/envwise)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/envwise/)、查看
[SVN 存放庫](https://plugins.svn.wordpress.org/envwise/)，或透過 [RSS](https://plugins.trac.wordpress.org/log/envwise/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/envwise/)。

## 變更記錄

#### 1.1.0

 * Renamed the plugin to Envwise Environment-Based Control (slug and text domain:
   envwise).
 * Renamed functions and constants to the envwise_ / ENVWISE_ prefix.
 * Existing settings are migrated automatically on activation.

#### 1.0.1

 * Confirmed compatibility with WordPress 7.1.
 * Fixed the “Plugin Disabled Behavior” setting being ignored on deactivation.
 * Standardized the text domain to env-control.
 * Hardened an admin notice against a fatal error when the current screen is unavailable.
 * Coding standards and documentation cleanup (WordPress-Extra/WPCS).

#### 1.0.0

 * Initial release of Environment Control
 * Automatic environment detection using WP_ENV constant or URL comparison
 * Automatic search engine indexing control for non-production environments
 * Admin dashboard with real-time environment status
 * Configurable production URL settings
 * Safe plugin deactivation behavior (restores search engine access by default; 
   configurable)
 * Visual indicators for production vs non-production status
 * Admin notices for non-production environment awareness
 * Extensible framework for custom environment-based controls
 * Developer functions for custom integrations

## 中繼資料

 *  版本 **1.1.0**
 *  最後更新 **1 天前**
 *  啟用安裝數 **少於 10 次**
 *  WordPress 版本需求 ** 6.8 或更新版本 **
 *  已測試相容的 WordPress 版本 **7.1.4**
 *  PHP 版本需求 ** 7.0 或更新版本 **
 *  語言
 * [English (US)](https://wordpress.org/plugins/envwise/)
 * 標籤:
 * [development](https://tw.wordpress.org/plugins/tags/development/)[environment](https://tw.wordpress.org/plugins/tags/environment/)
   [privacy](https://tw.wordpress.org/plugins/tags/privacy/)[search engines](https://tw.wordpress.org/plugins/tags/search-engines/)
   [staging](https://tw.wordpress.org/plugins/tags/staging/)
 *  [進階檢視](https://tw.wordpress.org/plugins/envwise/advanced/)

## 評分

這個項目尚無任何評論記錄。

[撰寫評分](https://wordpress.org/support/plugin/envwise/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/envwise/reviews/)

## 參與者

 *   [ David Tavares ](https://profiles.wordpress.org/davet86/)
 *   [ Alkesh Miyani ](https://profiles.wordpress.org/alkesh7/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/envwise/)