How to disable the WordPress auto code cleanup feature

As you would be aware I use WordPress regularly (this site is also wordpress) and being a web dev I tend to place html code in pages regularly, recently I’ve become more and more anoyed with the WordPress auto code cleanup function. After some Google Searching I found this little Gem “Smacking WordPress Editor, or Making It Stop Messing With Code” which outlines the basic process to dissable the auto code cleanup function. I’ve summarized below for you.

Gain access to your wp-includes/js/tinymce/tiny_mce.js file and find the below line which is near line 167.

this._def(“cleanup”, true);

and change it to this

this._def(cleanup”,false);

Save it back in place and presto! Your wordpress html editor should no longer cleanup your code! NOTE: You may need to clear your browser cache.

Cheers, questions in the comments.

 

Share

Tags: , , , , ,

No comments yet.

Leave a Reply