1
votes

I am using WordPress to code a site using hand-coded HTML, which I paste into the page editor of WordPress. But when I load that page using the built-in visual editor, tinyMCE is removing the <main> element from my markup and replaces it with &nbsp;

I'm familiar with users experiencing frustration with tinyMCE/WordPress injecting <p> elements or stripping empty tags, etc. But this one really stumps me. Any ideas?

1
it tends to do that :( its better to use wp editor just for text or remove the visual tab and use page templates = premium.wpmudev.org/blog/wordpress-custom-page-templateDavid

1 Answers

0
votes

This is due to the cleanup which TinyMCE does.

If you have edit permission you should add <main> as

valid_elements or extended_valid_elements.

You can set

valid_elements : '*[*]',

to allow all html tags.

You can also set verify_html to false.