How to remove srcset from media image in WordPress


WordPress 4.4 will add native responsive image support by including srcset attributes to the image markup it generates. It has some good purpose though what you will do to remove it. We can easily do it by calling the following line of code also make sure to put this code in functions.php of your active theme.

add_filter( 'wp_calculate_image_srcset_meta', '__return_null' );

Please Post Your Comments

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