WordPress tinymce prints empty P tag and break html format

You can disable the visual editor entirely in your profile settings. If you need to disable it on a per page basis, take a look at this answer.

Using text mode may not solve the empty paragraph problem, the wpautop filter is applied to the content regardless of how the content is edited. You can remove the filter, but then you’ll have to manually break and paragraph your content.

remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );

Alternatively, you can use a filter to strip out any empty paragraphs when displaying your content:

https://gist.github.com/ninnypants/1668216

Regarding the issue with the anchors, I haven’t had this particular issue with the editor. In general, if I am writing a lot of HTML in a post I like to use a “raw html” plugin. For example: https://wordpress.org/plugins/preserved-html-editor-markup-plus/

Leave a Comment