以下のコードをfunctions.phpに記述します。
function remove_img_wh( $html ) {
$html = preg_replace( '/(width|height)="d*"s/', '', $html );
return $html;
}
add_filter( 'post_thumbnail_html', 'remove_img_wh', 10 );
add_filter( 'image_send_to_editor', 'remove_img_wh', 10 );

