
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.

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.

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

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

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.”

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.

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.