The last few years we have been working for most of the time on responsive designed websites, and every time we are using ExpressionEngine and Wygwam module, we get complains from our clients regarding the automatic adding the inline css of the width + height when they add an image.

I've looked at this: Stopping WYGWAM from assigning dimensions to images

and this: https://stackoverflow.com/questions/2051896/ckeditor-prevent-adding-image-dimensions-as-a-css-style

But have not had any success to implemented with the latest Wygwam and it is annoying to doing hacks and have to renew it every time we update the module.

In one of the articles I've read, it says that I can add some code to config.js (where ever that is on the latest Wygwam):

config.disallowedContent = 'img{width,height}';

and that would solve the problem.

Can this be added as a default feature on future Wygwam releases, or a feature when we install Wygwam?


1 Answer 1


Here is the code I use to automatically resize images in Wygwam fields and remove the dimensions. It also stops them adding stupidly large images. It requires CE Image, but why wouldn't you have that installed anyway? The Bulk tag info is here, you just wrap it around your Wgwam field.

{exp:ce_img:bulk max="300" crop="no" allow_scale_larger="no" add_dims="no" attributes='style="float: right; margin-left:2%;"'}
{wygwam_field name}
  • I have this module installed - I'll give it a go. Thanks for your sugguestions
    – Rob Mol
    Commented Sep 15, 2014 at 9:00

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.