I’m looking for a solution that would allow me to write tags inside posts and be sure that the visual editor or wordpress will not alter them.
The same problem can apply for other specific HTML code that I may want to use.
Disabling the visual editor is not an option, because in will render most edit operation too hard to use.
Add the following to your theme functions.php:
I tried the accepted answer above and it didn’t work for me on WordPress 3.5.1
I looked inside wp-includes/kses.php and it said to use the ‘wp_kses_allowed_html’ filter.
This ended up working for me. You can replace the height and width attributes with any other script tag attributes such as type, language, etc.. depending on the tag you are trying to insert.