Jetpack by WordPress.com
[resolved] Disable Photon for gifs (3 posts)

  1. lelouchryu
    Posted 3 years ago #

    Hi i wanna know if theres any way to disable photon for gifs, it is great for jpg images, but gifs sometimes apperas break i also use upscaled gifs sometimes to create certain gallerys and the plugin make the gifs appear scaled breaking the simetry of the composition.

    Maybe theres some function i can put on my theme to make photon ignore the gifs or act only on jpg's (that would be even better).


  2. Jeremy Herve
    Jetpack Mechanic
    Plugin Author

    Posted 3 years ago #

    You could build you own function and use the jetpack_photon_skip_image filter to skip some of your images. Here is a super basic example:

    // Skip a image with Photon
    function tweakjp_photon_exception( $skip, $src ) {
            if ( $src == 'YOUR_IMAGE_URL' ) {
                    return true;
            return $skip;
    add_filter( 'jetpack_photon_skip_image', 'tweakjp_photon_exception', 10, 3 );
  3. lelouchryu
    Posted 3 years ago #

    Worked, many tanks for the tip.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Jetpack by WordPress.com
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic