Usage

How to use Profenv. Everything is done from Settings → Environment Settings (requires the manage_options capability).

1. Prepare your environment sets

On the “Environments & Detection” tab, manage your environment sets (display name, environment key, and detection domain). production / staging exist by default and cannot be deleted. You can register up to 10 sets in total.

2. Choose a detection method

  • Custom constant — pin the environment with define( 'PROFENV_ENV', 'production' ); in wp-config.php. The most robust method; the value survives database migrations.
  • WP_ENVIRONMENT_TYPE — the standard WordPress environment type (used only when it is explicitly defined).
  • Domain mapping — matches the site domain against the domain registered for each environment set. Works without touching wp-config.php.

3. Configure fields and values

Field definitions (key and type) are shared across all environments (the defaults are gtm_id / ga4_id). Each environment tab stores its own value for every shared key; the currently applied environment is marked with ● on its tab. Each environment can also define its own environment-specific fields (keys must not collide with the shared fields).

When gtm_id / ga4_id hold a value, the core plugin outputs the GTM / GA4 tags on the front end. All other keys are stored only and never output by the core (output is the responsibility of extensions or your theme).

4. Check the detection result

A status bar at the top of the admin screen always shows the currently applied environment and the detection method. When the environment cannot be determined, it is shown in a warning color and output of environment-specific values is suspended.

← Back to home

Copied title and URL