I spent some time trying to figure out why Drupal 7 strips all classes from tags in WYSIWYG.
My setup is: CKEditor library, version 126.96.36.199.
WYSIWYG module, latest stable release 7.x-2.2
It took me 2 hours going through forums and trying all sorts of solutions to figure out that this latest stable release simply does not support CK editor version 4.* I tried to add function into template.php, add custom function into a custom module, change editor config file, but nothing helped.
The answer came from a link on the WYSIWYG modulue page which shows the list of supported versions. The problem is that the latest stable relese does not support CK editor above 188.8.131.52. So if you are using 4 and above, you have to download the dev version.
Get 7.x-2.x-dev which adds a new option ‘Advanced Content Filter mode’. The ACF filter is disabled by default. This allows you to add any tags into WYSIWYG including class and style and when you switch source on and off, the tags will stay in place. You can even add <style> tag to WYSIWYG if you want to, it works just fine.
Hope this helps to anyone desperately trying to find a solution to a simple problem why Drupal strips tags and classes in WYSIWYG, while they you are using the latest stable version of WYSIWYG module.