With Staging Mode, you can clone your site to a staging environment without polluting the data used by WordPress.com.
Note: This is specifically for online, staging sites. If you have a local development site, you’ll want to follow the Offline Mode guide instead.
The Jetpack plugin tries to automatically detect staging sites based on the default way WordPress defines environments and patterns used by some hosting providers. We’re usually able to detect staging sites and automatically enable Staging Mode on the following platforms:
- WP Engine
- WP Stagecoach
However, this won’t work in all cases. If needed, you can manually turn on Staging Mode by adding
define( 'JETPACK_STAGING_MODE', true ); to your staging site’s
wp-config.php file. Make sure you add it before the
/* That's all, stop editing! Happy blogging. */ line.
Note: Your staging site’s homepage must be publicly accessible in order to use Staging Mode. Staging sites behind a login page are not compatible with Staging Mode.
Using Staging Mode
When your Jetpack site is accessed in staging for the first time, you will get a “Safe Mode” warning as Jetpack will notice that the staging site is a copy of your production site.
Since this is a “new” site, you will want to click the button “Create a fresh connection”.
Recommended Staging Workflow
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 Jetpack staging constant.
- 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.
If your hosting provider includes functionality to create a staging site using an automated process, you can use that. When accessing the staging site, you will get a “Safe Mode” prompt.
You will want to “Create a Fresh Connection”, make your changes, and then deploy staging to production.
The flow, in this case, would be:
- 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.
How Staging Mode Works
While in Staging Mode, your staging site will act like your production site in virtually all ways, except no data is passed up to WordPress.com and you cannot disconnect the staging site (to prevent an issue that would lead to problems with your production site).
Jetpack Features that Will Not Work in Staging Mode
- Activity Log
- Google Analytics
- Instagram Widget
- JSON API
- Post by Email
- Jetpack Social
- Brute Force Attack Protection
- WordPress.com Toolbar
- Extension: Unrolling Tweet Threads
- Recurring payments
- Pay with PayPal
- VideoPress Block
- Mailchimp Block
How to Disable Staging Mode
If your site is hosted with one of the providers listed at the top of this page, and we’ve automatically placed your site into Staging Mode, there may be certain situations where you want to disable it — for example, in order to test Jetpack features that don’t work in Staging Mode. To disable it, you can add this line of code to your theme’s functions.php file:
add_filter( 'jetpack_is_staging_site', '__return_false' );
Still having trouble?
Please contact support directly. We’re happy to lend a hand and to answer any other questions that you may have.