Detecting the production environment VIP platform specific

This document is for sites running on VIP.

Learn more

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

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

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?

Drop us a note.

No matter where you are in the planning process, we’re happy to help, and we’re actual humans here on the other side of the form. 👋 We’re here to discuss your challenges and plans, evaluate your existing resources or a potential partner, or even make some initial recommendations. And, of course, we’re here to help any time you’re in the market for some robust WordPress awesomeness.