Page 1 of 1

How to remove WordPress srcset tag for old posts images prior WP 4.4

Posted: Wed Jun 29, 2016 8:25 pm
by axew3
To solve all problems reported here:
https://make.wordpress.org/core/2015/11 ... press-4-4/

Code: Select all

function srcset_remove( $sources ) {
	  return false; // this will nullify srcset added to img tag on images since wp 4.4 
	  // todo: return correct value for the wp_calculate_image_srcset filter
}

add_filter( 'wp_calculate_image_srcset', 'srcset_remove' );
You may would like to run this, only for old posts with date prior your WP update to 4.4 or >