Removing Width/Height from the Image Uploader

A lot of WordPress users have wanted to prevent WordPress 2.5.x from inserting the width and the height, when uploading the images in the new 2.5 media manager. You can do this with a simple code by adding into your theme’s functions.php file. The code in question is a WordPress filter, that’s called as image_downsize, which takes in […]

A lot of WordPress users have wanted to prevent WordPress 2.5.x from inserting the width and the height, when uploading the images in the new 2.5 media manager. You can do this with a simple code by adding into your theme’s functions.php file. The code in question is a WordPress filter, that’s called as image_downsize, which takes in three arguments (a boolean, an attachment ID, and a size string).

add_filter('image_downsize', 'my_image_downsize',1,3);

As a result, when the image is sent to the editor, the above filter calls the my_image_downsize function in wp-includes/media.php with the default priority and arguments, and no width or height is present.

If you’re not comfortable with coding, you can download sample functions.php or a plugin.