How to Enable Jetpack Development Mode

How to Enable Jetpack Development Mode

Did you know Jetpack has a development mode? Until recently, I didn’t.

While Jetpack is in development mode, features that do not require a connection to the WordPress.com servers can be activated and used on a local WordPress environment for testing and debugging.

To activate Jetpack’s development mode, you’ll add the snippet below to your wp-config.php file. You’ll want to make sure that you add it before the /* That’s all, stop editing! Happy blogging. */ line.

define('JETPACK_DEV_DEBUG', true);

Jetpack’s development mode is automatically enabled if you local installation’s hostname doesn’t contain a period, i.e. localhost. If you use a different URL, such as what I do when running a local development environment, like daharveyjr.dev for instance, then the JETPACK_DEV_DEBUG constant needs to be defined in order to activate development mode.

NOTE: While using Jetpack’s development mode features that require a WordPress.com account will not be available at all, features such as: Related Posts and Publicize. Other features may have reduced functionality to give developers a valid, working representation of the feature.

Author: daharveyjr

I’m a solution architect responsible for the design, development, implementation, testing, and maintenance of e-commerce operations and applications using the Hybris and WebSphere Commerce product suites and other web technologies such as Java, J2EE/JEE, Spring, PHP, WordPress and more. Twitter | Facebook | LinkedIn

4 thoughts on “How to Enable Jetpack Development Mode

  1. Larry H Reply

    Enabling development mode doesn’t work at all for me. With or without JETPACK_DEV_DEBUG (on my http://localhost, which according to the above, defaults to dev mode), it just plain doesn’t work – never invokes any of the filters in after-the-deadline.php, so nothing happens on an admin-ajax call.

    • daharveyjr Post authorReply

      Larry, I would make sure you’ve defined the JETPACK_DEV_DEBUG constant in the wp-config.php file. I’ve also enabled this on local development sites, and have not seen it fail if defined in the correct place. However, if that doesn’t work, there are other options to enable development mode that you could test against as well.

      1. You could try adding the ‘jetpack_development_mode’ filter by adding the following filter to your functions.php file:

      add_filter('jetpack_development_mode', '__return_true');
      

      2. Jetpack 3.9 also introduced a hook/filter to add a site as a staging website, forcing it into a development non-production mode. To enable that filter add the following to your functions.php file:

      add_filter('jetpack_is_staging_site', '__return_true');
      
  2. Prasad Reply

    Hello,

    And how to disable the development mode? I just transferred my website from one host to another and the jetpack development mode doesn’t go away.

    • daharveyjr Post authorReply

      Prasad, development mode automatically enables if your domain doesn’t have a period in your sites hostname (i.e. localhost), if that doesn’t apply, and you’ve validated that your site is properly connected to Jetpack, you can try and force development mode off by switching the constant ‘JETPACK_DEV_DEBUG’ to ‘false’, and changing the ‘jetpack_development_mode’ filter to ‘__return_false’.

Leave a Reply

Your email address will not be published. Required fields are marked *