How to Disable Photon in JetPack

Written by Jean Galea
Written by Jean Galea

Last updated on 29 Jun 2017

Just a quick tip to share how you can disable Photon, one of the features in Jetpack. A reason to do this might be to have more control over the cropped and resized images it generates. You just need to go to the JetPack page, then click on 'Learn more' in the Photon box, and then 'Deactivate'.

WP Mayor is supported by its audience. If you purchase through a link on our site, we may earn a commission. Here’s why you can trust us.

Table Of Contents

Table of Contents

Before We Get Started

We found a fully managed WordPress host with fantastic speed, security, and support that has performed consistently for many of our sites.

WP Engine’s longevity and reputation speak for themselves. They offer a hosting platform that allows you to build, test, and deploy faster, along with built-in performance optimizations, backups, and much more.

Try it today and save $100+ in your first year.

With that said, let’s get started…

Introduction

Just a quick tip to share how you can disable Photon, one of the features in Jetpack. A reason to do this might be to have more control over the cropped and resized images it generates.

You just need to go to the JetPack page, then click on ‘Learn more’ in the Photon box, and then ‘Deactivate’.

There’s also a way to do it via code:

/* Remove Photon on this site */

$photon_removed = remove_filter( 'image_downsize', array( Jetpack_Photon::instance(), 'filter_image_downsize' ) );

// Call wp_get_attachment_image(), wp_get_attachment_image_src(), or anything else that ultimately calls image_downsize()

if ( $photon_removed )
	add_filter( 'image_downsize', array( Jetpack_Photon::instance(), 'filter_image_downsize' ), 10, 3 );

If you want to confirm whether JetPack is active, you can use this code:

add_action( 'admin_notices', 'wpse_75103_active_jetpack_modules' );

function wpse_75103_active_jetpack_modules() 
{
    if( !current_user_can( 'delete_users' ) )
        return;

    $jetp = get_option( 'jetpack_active_modules' );

    $photon_active = ( in_array( 'photon', $jetp ) ) ? 'is' : 'is not';
    echo '<h1>Photon ' . $photon_active . ' active</h1>';

    echo '<h2>All JetPack Options</h2>';
    echo '<pre>' . print_r( $jetp, true ) . '</pre>';
}

If you enjoyed this post, make sure to subscribe to WP Mayor’s RSS feed.

<span style="font-weight: 400">Written by: </span>Jean Galea
Written by: Jean Galea

Jean Galea is an investor, entrepreneur, and blogger.

He is the founder of WP Mayor, the plugins WP RSS Aggregator and Spotlight, as well as the Mastermind.fm podcast.

His personal blog can be found at jeangalea.com.

BionicWP

Quick Links

Did you find this article helpful?

Share Your Discovery

One Response

Leave a Reply

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

Discover more tips and tools.
Join 5000+ designers, developers, and site builders who follow us to receive the best guides, tools, and services for their website builds every week.

Hey, design enthusiasts...

Elevate your website designs with our free transformative guide on the 60-30-10 rule.

Discover how this simple, yet powerful, principle can make your designs infinitely better!

By downloading this guide, you are opting in to our email list. We don’t send spam. You may unsubscribe any time.

What's missing?