I found this gist on Github:
/*————————————————————————————–*/
/* Remove width/height attributes from featured image */
/*————————————————————————————–*/
function remove_thumbnail_dimensions( $html, $post_id, $post_image_id ) {
$html = preg_replace( ‘/(width|height)=\”\d*\”\s/’, “”, $html );
return $html;
}
add_filter( ‘post_thumbnail_html’, ‘remove_thumbnail_dimensions’, 10, 3 );
After I implement it, how would I know if it worked?
Thank you!