unwanted and tags in text editor

I’m very surprised that an answer to this isn’t easy to find. I’ve been searching for a solution to this problem for some time now. Google has a few sketchy answers, but they’re old. My question is this:

When I’m adding content to a page, I prefer to use the “text” tab (not the “visual” one), and I often paste in a large amount of HTML. Each time I do so, and update (save) the page, when I come back, the code has been changed. br tags are added, things are changed to unwanted paragraph tags, etc.

I found this on codex:
In formatting.php Change the line

function wpautop($pee, $br = 1)

to
function wpautop($pee, $br = 0)

…but I’m opposed to changing the core files (as we all are!).

I’ve seen ways to turn off TinyMCE, but those articles are over 8 years old, and aren’t relevant any longer.

So is there any way I can put in code into the text editor, and have it stay strictly the way I put it in? I’m open to all solutions – I won’t be offended if a plugin recommendation is made.

0

Leave a Comment