Can I disable optimization for a certain image ?

Option 1:
You can follow this code snippet and replace the sample image with the one you need:

add_filter('optml_dont_replace_url', function( $old, $url ) {
     if ( $url === 'https://example.com/wp-content/uploads/2018/09/1.jpg' ) {         
         return true;    
     }    
     return $old;  
}, 10, 2);

Option 2:
A more user-friendly method is described in this article: Exclude from Optimizing or Lazy Loading

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us