I know a few people have asked this question previously; however, I think something may have changed recently in the Wordpress update.

I'm building my own responsive theme for my portfolio, and for embedded post images I have added a filter to functions.php to remove the height/width attribute that Wordpress adds to the image automatically. I have used this filter before on other sites therefore I know it should work.

However, no matter what I try I can't get Wordpress to embed the image without the height/width attributes, meaning the image doesn't resize on mobiles/tablets.

Demo for the image in question is here:


Any help would be greatly appreciated.



  • this was originally a cross-post, after migration now a dupe of this question
    – Milo
    Dec 20, 2012 at 17:36

1 Answer 1


Is this through the post thumbnail functions, or TinyMCE?

If it's through the post thumbnail, you should be able to blank out those attributes like this:

the_post_thumbnail('thumbnail', array('height' => '', 'width' => ''));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.