What happened to formatting HTML in Wordpress?

The Wordpress text editor for posts no longer seems to display <div>, <p>, or   where paragraphs or sections are separated but still separates the paragraphs without these formatting tags. Why and how was this done? The reason I ask is because when I use a browser on my iPad to edit an article (rather than the WP app), the paragraph formatting sometimes gets wiped out. Why?

  • faydra_deon
    • WordPress Warrior


    I've been using WordPress since version 3.5, and WordPress has always natively stripped the paragraph tags unless there are styles attached to them.

    I use the TinyMCE Advanced plugin to get around this, because there's an option to "Stop removing the < p > and < br / > tags when saving and show them in the Text editor."

    I've never had WordPress strip my div tags, though, so I'm not sure why that's happening.

    If you don't want to use the above plugin, you can keep WordPress from stripping your paragraph tags by adding the style attribute to them. Like this:

    <p style=""></p>

    You don't actually have to put anything in the style attribute, but it'll keep WordPress from stripping it out. It may also work to keep your div tags in there, but like I said before I've never had it strip divs.

    I hope this helps.


  • Vinod Dalvi
    • WP Unicorn

    Hi @wadams92101,

    Greetings and thanks for posting on the forums.

    The updated version of TinyMCE 4 has been implemented in the WordPress version 3.9 which results in this behavior. The latest TinyMCE included in the WordPress does not allow to use these tags in the post editor but it still displays the paragraph and line breaks without displaying its markup.

    In the CMS it is always recommended to make the data / information separate from the code to make it more manageable.

    Could you please tell me which browser are you using on your iPad?

    Vinod Dalvi

  • Jack Kitterhing
    • Code Norris

    Hi there @wadams92101,

    Hope you're well today, just to clarify, your using the normal WordPress admin (not the app).

    And the standard visual editor (not text), correct and it's stripping the tags for the paragraphs and divs?

    Can you grant me support access to your site please via the WPMU DEV dashboard > support > support access and click "Grant Access".


    Kind Regards

  • faydra_deon
    • WordPress Warrior


    Here's a link to an article in WordPress.org's codex of how to disable wpautop, so it will stop stripping your p-tags and linebreak-tags: http://codex.wordpress.org/Function_Reference/wpautop

    Here's a link to an article written back in 2002 by Matthew Mullenweg, one of the founders of WordPress, explaining the stripping of the tags (cleaner content): http://ma.tt/scripts/autop/

    The Codex article also references a plugin that you can use to enable and disable the wpautop on a post-by-post basis. Here's the link: http://wordpress.org/extend/plugins/wpautop-control/

    Like I mentioned in my first post, the stripping of p-tags and linebreak-tags has been going on in WordPress for some time.

    The article at this link: http://www.digitalfamily.com/faq/why-does-wordpress-remove-paragraph-breaks/ written back in 2012, says it's a "problem" that's been going on for some time, like it's a glitch or a bug. It's not. It's done by design. The problem is that many people don't like it. This article also suggests the plugin I mentioned earlier, TinyMCE Advanced.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.