Detecting the WordPress.com production environment

If you want to detect whether or not your theme is running in the WordPress.com production environment, you can use logic like this:

if ( defined( 'WPCOM_IS_VIP_ENV' ) && true === WPCOM_IS_VIP_ENV ) {
    // Running on WordPress.com
} else {
    // Not running on WordPress.com
}

This can be helpful for setting other environment variables that are specific to the hostname or environment where the code is executed. However, we strongly advise against any logic that makes functionality exceptions for your development environment; development and production environments should be as close as possible to avoid unexpected production-specific issues.

Ready to get started?

Tell us about your needs

Let us lead the way. We’ll help you select a top tier development partner. We’ll train your developers, operations, infrastructure, and editorial teams. We’ll coarchitect your deployment processes. We will provide live support for peak events. We’ll help your people avoid dark alleys and blind corners, and reduce wasted cycles.