How to Disable All External Requests in Jetpack WordPress Plugin

I have been using a new theme recently on one of my other sites. It has a custom post type which requires Jetpack to be enabled. I’m not usually a fan of Jetpack due performance and all of their external requests. I prefer to load things from my own HTTP/2 enabled CDN. I also have better plugins or systems in place for a lot of what Jetpack offers. However, there are ways to get around this. Follow the steps below on how to disable all external requests in the Jetpack WordPress plugin.

Disable All External Requests in Jetpack WordPress Plugin

By default when you install Jetpack, you will notice a lot more HTTP requests. Most of them are calling to external domains.

Jetpack external requests

Jetpack external requests

Here is what I showed:

  • https://s0.wp.com/wp-content/js/devicepx-jetpack.js
  • https://secure.gravatar.com/js/gprofiles.js
  • /wp-content/plugins/jetpack/modules/wpgroho.js (this one actually loaded locally)
  • https://stats.wp.com/e-201728.js
  • /wp-content/plugins/jetpack/modules/likes/queuehandler.js  (this one actually loaded locally)
  • https://secure.gravatar.com/css/hovercard.css?ver=201728
  • https://secure.gravatar.com/css/services.css?ver=201728
  • https://pixel.wp.com/g.gif

If you aren’t utilizing all these features this is a big problem as this generates more requests, additional DNS lookups, additional TLS handshake delays, etc. Thankfully though disabling all the requests in the Jetpack plugin is pretty easy to do. And you can then enable the single feature you need or want.

Step 1

First, click into “Settings” within the Jetpack plugin.

Jetpack settings

Jetpack settings

Step 2

Scroll all the way down to the bottom and click on “Debug.”

Debut Jetpack

Debut Jetpack

Step 3

Click on “Access the full list of Jetpack modules available on your site.”

Jetpack modules

Jetpack modules

Step 4

Click the box to select everything and from the dropdown select “Deactivate.” Some of these don’t generate external requests, but this is a fast way to disable everything except for what you need. In my example, I am unchecking the “Custom content types” because that is what my new WordPress theme uses for the portfolio custom post types. Then click “Apply.”

Deactivate Jetpack modules

Deactivate Jetpack modules

Step 5

That will take care of every request but one. There is one additional JavaScript file, devicepx-jetpack.js, which is called to manage image replacements on devices that have HiDPI (High DPI) and Retina displays.

devicepx-jetpack.js

devicepx-jetpack.js

To get rid of this you will need to put the following code in the bottom of your theme’s functions.php file. Unfortunately, they don’t have a way to disable this in the plugin settings. Don’t ask me why.

function tj_dequeue_devicepx() {
 wp_dequeue_script( 'devicepx' );
}
add_action( 'wp_enqueue_scripts', 'tj_dequeue_devicepx' );

And that’s it! Make sure to clear your cache afterward to ensure that last request is gone.

Summary

I’m not a huge fan of the Jetpack plugin when it comes to performance, especially for those that might not understand everything that is loading. But thankfully it is pretty easy to toggle things on and off, as well as disable requests when they aren’t needed. What are your thoughts of Jetpack? Let me know below in the comments.

GET MORE STUFF LIKE THIS

Marketing, WordPress, Blogging Tips, SEO and Reviews, once a week.

Thank you for subscribing.

Something went wrong.

3 Shares
Tweet
Share
Share
Buffer