When you paste an image with a class attribute in the Wysiwyg editor, the pasted image no longer has this class attribute.

This makes it harder to copy and paste images that are aligned with the alignleft or alignright classes.

This used to work in WordPress 2.7, but it no longer works in WordPress 2.8 and up. It also works in the "base" version of TinyMCE (tested with 3.2.7 and, so it is probably something that is added by WordPress. I tested this in Safari, Firefox 3.6 and Chrome on Mac OS X.

This has been mentioned in a Trac ticket but the main item was dismissed as a browser issue - but I think the class issue is not.

Has anyone else found a way to make this work?

  • @menardmam: What browser do you use? The Wysiwyg editor uses browser capabilities, it is possible that this works in one browser but not in the other.
    – Jan Fabry
    Apr 7, 2011 at 10:02
  • firefox all the way, never change, just updated
    – menardmam
    Apr 7, 2011 at 10:05
  • Wait, I'm not sure if I understood. You write something like <a src="#" alt="Something" class"myclass" /> and after you paste it to WP and publish tere is only <a src="#" alt="something />? And when you paste it how does it look? Screenshot from the place you prepare your code and WP could help a lot. Apr 7, 2011 at 10:15
  • @menardman: I tested this myself and can confirm this. It stopped working in WP 2.8! This will probably be a bug in WordPress itself, once we figure it out we can maybe submit a patch to WordPress so it is fixed in the next release.
    – Jan Fabry
    Apr 7, 2011 at 11:00
  • 3
    Pasting in HTML mode doesn't appear to exhibit this problem.
    – t31os
    Apr 9, 2011 at 12:21

1 Answer 1


Instead of pasting into the Visual editor, switch to the html editor for pasting any kind of html, or using shortcodes.

I'd recommend checking the "disable the visual editor" checkbox in your user profile. Then install Mark Jaquith's Markdown on Save plugin for more readable formatting without the wysiwyg pitfalls.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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