WordPress Environment Types

Overview

Environment types set in WordPress via WP_ENVIRONMENT_TYPE and an optional variable that refers to the different stages of website development and deployment. Some plugins and themes can use the environment type to modify their behavior or configuration differently depending on the stage of development.

Note: Setting a WordPress environment type is optional and new sites are created with no environment type set. There is no negative impact on your site if you leave this unset.

To change the environment type, go to the My.Pressable.com Dashboard and select an individual site, then go to Advanced > WordPress Environment:

Screenshot showing where to set WordPress Environment for individual site

Available Environment Types

Local

The local environment type is typically used for WordPress development sites that are installed on a local computer or local server for development, testing, and debugging purposes. While it is rarely used in hosted environments like Pressable, it is in place to support specific development workflows.

Development

Similar to the local environment, the development environment is used for testing a WordPress site before it is launched on the staging platform. Normally, this is remotely accessed using SSH or SFTP.

Staging

Before launching the WordPress site to the live production environment, it undergoes testing in an environment that resembles the production environment. This testing environment should be an exact copy of the live environment and is used to validate any modifications or upgrades before they are implemented on the live site. This state aligns with Pressable sites set to Staging status.

Production

The live environment is where end-users access the WordPress site, making it crucial to maintain its stability and security at all times. Any alterations made to this environment will be immediately noticeable to the site’s users, emphasizing the importance of ensuring its reliability. This state aligns with Pressable sites set to Live status.

More on WP_ENVIRONMENT_TYPE and related functions can be found on WordPress.org.


How Different Environment Types Behave

Not all plugins or themes will act differently in different environments, but for those which do some of the ways they may adjust include:

Conditional activation

The environment type variable can be used by plugins to decide if they should be activated or not. For instance, a debugging plugin might only activate in the development environment and not in the production environment.

Conditional settings

By utilizing the environment type variable, plugins can adjust their settings according to the current environment. For example, a caching plugin might apply distinct caching settings for the development environment compared to those for the production environment.

Conditional behavior

The behavior of plugins can be altered based on the environment type variable. For instance, a backup plugin may operate more frequently in the production environment than in the development environment.

Conditional notifications

Notifications or alerts can be sent by plugins using the environment type variable, depending on the current environment. As an example, a security plugin may send notifications more often in the development environment than in the production environment.