apply_filters ( 'jetpack_photon_skip_image', bool false, string $src, string $tag )

Allow specific images to be skipped by Photon.

Source file: class.photon.php

View in GitHub



(bool) false Should Photon ignore this image. Default to false.


(string) Image URL.


(string) Image Tag (Image HTML output).


Since: Jetpack 2.0.3


To exclude an entire post or page from using Photon, you can modify this snippet to fit your needs and add it to your theme’s functions.php or a core functionality plugin:

function no_photon_by_page() {
  if ( is_page( 2 ) ) {
    add_filter( 'jetpack_photon_skip_image', '__return_true');

add_action('wp', 'no_photon_by_page');

In this example, Photon won’t be used on the page with the ID of 2, but you can use any of the WordPress Conditional Functions.

If you’d like to exclude an image from being cached and served by Photon, you can add the following code to your theme’s functions.php file:

function my_photon_exception( $val, $src, $tag ) {
        if ( $src == 'YOUR_IMAGE_URL' ) {
                return true;
        return $val;
add_filter( 'jetpack_photon_skip_image', 'my_photon_exception', 10, 3 );

To exclude images from a specific domain, you can use the following code:

function htdat_photon_exception_for_domain ( $val, $src, $tag ) {
        $parse = parse_url( $src ); 
        $img_domain = $parse[ 'host' ]; 
        // specify the domain you want to exclude here. Note: www and non-www are different
        if ( $img_domain == '' ) { 
                return true;

        return $val;
add_filter( 'jetpack_photon_skip_image', 'htdat_photon_exception_for_domain', 10, 3 );

Have a note to contribute?

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


  1. heri wahyudianto says:

    in single.php, I need featured image only skip photon. not all image. how to modify ‘YOUR_IMAGE_URL’ ?