Safely use Jetpack with a staging site.
When you make a copy of your site for testing or development, Jetpack checks the WP_ENVIRONMENT_TYPE
variable in the wp-config.php
file. Read more on how to configure this variable.
This is a feature used by many plugins and web hosts. If the variable is set to staging
or development
, Jetpack will turn off the option to move site settings to the test site. This helps protect the live site from any changes made in the test environment.
Note: This guide is for online staging sites. If you have a local offline development site, please follow the Offline Mode guide instead.
Recommended workflow between staging and production sites
Manual process
In terms of a workflow between your production and staging sites, we’d advise the following:
- Migrate the database from your production to staging site.
- Make sure to flag the staging site with
WP_ENVIRONMENT_TYPE
. - At the “Safe Mode” prompt, click “Create a fresh connection”.
- Make your changes on the staging site.
- Migrate your changes back to your production site.
- When you access your WP Admin on your production site, click “Create a fresh connection” when the “Safe Mode” prompt displays.
- Since this is a “new” site, click the button “Create a fresh connection”. This will restore the old connection on the production site.
Automated process
Ask your hosting provider if they automatically set the WP_ENVIRONMENT_TYPE
. If so, you can use the steps below:
- Clone to Staging.
- Staging site will enter “Safe Mode”.
- Create a fresh connection.
- Make changes to the staging site.
- Move to production.
- On production, you will get the “Safe Mode” warning again.
- Create a fresh connection since this is now a “new” connection compared to the staging environment.
Use staging mode
When your Jetpack site is accessed in staging for the first time, you will get a “Safe Mode” warning when Jetpack notices that the staging site is a copy of your production site.
There are three options:
- Move Jetpack data from your production site to the staging site (not available if the site marked as staging via
WP_ENVIRONMENT_TYPE
) - Treat each site as independent sites, creating a fresh Jetpack connection
- Decide later and stay in Safe Mode, best used when:
- site is created for short-term testing and will be deleted soon
- site will be cloned back to production after testing

Jetpack features that do not work in Safe Mode
- Activity Log
- Backup
- Brute Force Attack Protection
- Donations
- Firewall
- Instagram Widget
- Jetpack Social
- JSON API
- Mailchimp Block
- Monitor
- Notifications
- Pay with PayPal
- Post by Email
- Recurring payments
- Scan
- Search
- SSO
- Subscriptions
- VideoPress
- VideoPress Block
- WordAds
Re-enable connection migration
If the site is using the WP_ENVIRONMENT_TYPE
set to staging, but you need to enable connection migration anyway, use a filter:add_filter( 'jetpack_is_development_site', '__return_false);
The code can be added to any existing plugin or via Code Snippets or a similar plugin.
Still need help?
Please contact support. We’re happy to advise.