WordPress is an effective tool for web development but occasionally it has some issues.
One thing that is frustrating is when WordPress decides to strip HTML markup. This is a problem when you type in custom HTML in the text editor and then switch to the visual editor.
Why Not Just Shut Off The Visual Editor?
Well you might be saying, why not just use the text editor only and shut it off permanently in your preferences?
That’s fine but formatting bullets, lists, headers, and other common tasks are now more time consuming. You are forced to either mark it up yourself by hand, or use an external editor. Neither is appealing.
Sure, there are a few options in the text editor left like bold, italic, link, and the lists code, but now you have to manually use the list function. That’s not quick anymore and is prone to error.
Secondly, you can’t see how it will look without using a second window to preview any changes.
There has to be a better way.
Options to Prevent WordPress From Stripping HTML
The first method will be to use a drag and drop page builder. One top rated builder is Elementor. Not only can it build stunning pages, but posts too.
What’s great about a page builder is that you don’t need a bunch of plugins to solve every last issue with the editor.
For example, if you need some HTML code, no problem. Just drag it in where you need it and WordPress won’t override your decision and strip it out like this:
Elementor has a WYSIWYG editor so everything you type is updated in the screen to the right in real time.
Elementor is also responsive for any device like mobile and that functionality does not exist in the standard WordPress editor.
Upgrade The WordPress Editor
Another option to prevent WordPress from stripping HTML markup is to upgrade the editor.
A popular plugin that is customizable is the TinyMCE Advanced. This plugin adds all kinds of capabilities to the standard editor.
When Possible, Embed HTML Markup in Headers
Another way to preserve markup is to embed the code into a header. This only works on a case by case basis.
For example. Say you want to program a Link or a Button to jump to a portion of a page.
No problem. Here’s how to do it.
First create the link normally, say “Jump to Section” and then for the link location, use the link tool and assign it a value such as
Next create the target.
If you were marking this up with a pagebuilder, you could put the target wherever you wanted by dragging in an HTML box. We are going to get around the text editor stripping issue without using a plugin by placing it in a header like this.
Now the id tag will be preserved in the header no matter if you switch to the visual editor or not.
Create Anchor With TinyMCE
The example above is really simple when using the TinyMCE editor. All you need to do is to highlight the text that you want, then select the anchor symbol and type in the target. The link to the target could be anywhere and is added normally using the link tool
It’s not a good idea to overlap functions with plugins. So, if you are trying to solve issues like stripping HTML with the visual editor, choose a single plugin that works for you.
We’ve shown you two easy ways to overcome this problem, with a drag and drop page builder or an upgraded editor option.
Either method will help you build pages faster the way you want to build them without being over-ridden by an algorithm.