Disable wpautop Plugin

A simple plugin to disable the WordPress wpautop function. This is the function that automatically formats your posts.

Installation

Installation is just like any WordPress plugin:

  • Download disable-wpautop
  • Unzip
  • Upload to /wp-content/plugins on your server
  • Activate the plugin

You can find full details of installing a plugin on the plugin installation page.

If you find that breaks (<br/>) are being stripped from your posts then look at this WordPress support page.

123 comments

  1. John,
    I have today installed the plugin, but WordPress is Still (gRr) formatting my HTML when i place it in using the source editor. What version was this plugin built for please?
    Thanks
    Mark

  2. Using WordPress 2.1, the one that has the p/div tag issue.
    This plugin is a godsend to me. Thanks ever so much. I have gone two nights without sleep to fix that damn bug and now I can finally get some rest.

    Cheers to you, man.

  3. wildframe, cutout: I’m using it on WordPress 2.1 and it works fine. Can you give me some details about how it’s not working for you?

  4. Apologies: I installed 2.1.2 from scratch and all seems to be well — thanks for this plugin! I’ll report back if there’s any weirdness.

  5. I’m using WP 2.1.3. I navigated to the Code tab and placed tags After that I saved the post. Now when i open the same post and again go to the Code view, the tags aren’t there anymore?

    You can have a look at my blog, the top post is the one that doesn’t retain the p tags. I installed Ardvark extension for FF (https://addons.mozilla.org/en-US/firefox/addon/4111) to see which code was WP applying to the paragraphs. It says “p class para” I have no class by the name of para in my CSS.

    Thanks in advance.

  6. Question for you: I have been editing and re-editing fricken tags over and over because WP keeps clearing out my "style=’float:right’". It works once, but if I go to re-edit the page for any reason, it strips out the style tag.

    will this plugin stop that behavior? Yes, I know, use css.

    ps, I highly recommend you get and install the "subscribe to comments" plugin. lets users subscribe to the comments and get notified when a comment is replied to. Generates more page views as well as happy commenters getting answers to their questions

  7. Rob, are you logged in as an admin user? WP can strip certain things out if you are not admin. This plugin may solve your problem (but then it may not be the fault of the auto paragraph function). I’ve tried entering style tags myself and it works fine, so something is definitely playing with you.

    Subscribe to comments is coming soon along with a forum!

  8. HI Guys,

    I am using WP 2.1 and also had the plugin fail. However, I thank John for taking the time to share his findings, and develop a plugin.

    I was having the "div" tags stripped out of my pages and replaced with "p"’s. What happens is TinyMCE is programmed to replace tags it does not recognize. Therefore, we just need to bring whatever the ‘problem’ tag is to TinyMCE’s attention, and let it know we want to include it as a valid tag/element.

    Here is the solution I found for correcting the "div" issue. You can use these same instructions for including additional tags however.

    1. Open the file called tiny_mce.js located in the wp-includes\js\tinymce folder
    2. Goto line 130 – look for this: this._def("extended_valid_elements", "");
    3. Change it to this: this._def("extended_valid_elements", "div[id|class]");

    Note – You can add other tags in here too if they are giving you problems. Just separate the elements with commas, and include any sub elements within the brackets (I have added the id and class sub-elements above so that they will not be stripped out of the div element. If you wanted to add "style" as a sub element, just append a "|" (no quotes) to "class" and end up with: div[id|class|style]). If you wanted to add an additional element, do this: "div[id|class],br,embed[class|id]". There should only be one set of quotes embracing all of your elements.

    That’s it! Hope it helps. I cannot promise this will work for everyone, but it worked for me. Best of luck!

  9. My website – notsonews.com – is powered by wordpress 2.2.1 and this plugin works like a charm. I have posted a "thank you" message and a "do follow" link towards this page on my about pages. Many Thanks!

  10. Once again a lifesaving plugin. Next time, I won’t even try to find answers to my issues from Google or WordPress support forums. I’ll come straight at the Urban Giraffe. My issue was that I was pasting bits from old html pages (with linefeeds in-between p tags, which are supposed to be transparent), and the wordpress editor (even the ‘code only’) managed to make every single line into a paragraph. Solved now. Thank you so much.

  11. Pingback: tv-game.jp
  12. Pingback: tv-game.jp
  13. […] 自動整形機能を無効にするプラグイン。似たようなプラグインにDisable wpautopという <p> タグ入力を無効にするプラグインもあるけど、<p> タグを逆に利用したかったので導入していません […]

  14. This plugin is incompatible with TinyMCE, since whenever you’ll edit your page in WYSIWYG, it will remove all the p tags you’ve put in.

    I couldn’t get the Scott’s suggested hack fix (above) to work with WP 2.5.1, and concluded that disabling wpautop is probably much more complicated than this plugin makes it seem.

  15. Pingback: delete
  16. Okay so I am just as annoyed at the behavior of this plugin as I was with my initial problem. I want something to work on a per post basis. I installed this plugin and everyone of my posts (and pages) suddenly had no paragraphs or breaks in them! It was like one HUGE run-on sentence. I checked every support page I can find yet nothing. One page told me there is some sort of config page that can fix this, but atlas, no config page can be found in my dashboard or menus at all.

    See the problem is 1 post of mine has a form in it. Every textarea and input box gets its own line break! So if I say “username: [input]” the output on worpress becomes “username:[br] [input][br]”. I don’t want to have to edit hundreds of posts to fix my past posts linebreaks, nor do I want the linebreak to be fixed in the future…. I only want it for this post!

  17. Thanks for the thought, but I just got this plugin for WP 2.8.6 and it removes all my paragraph formatting on my pages only! Doesn’t seem to effect posts, but now my pages are just one big paragraph. I guess it doesn’t work for everyone. I see WP has been ignoring this issue for over a year.

  18. Hello John,
    Thank you for your useful plugin.
    I just tried it with WordPress v2.9.2 and it seems that the editor is still adding automatically the tags, I did not want to have.
    Do you think it has to do with Worpdress latest version or me having something weird somewhere ?

    THANK YOU for your help !
    Jamy

  19. Wowsers! This put an end to hours upon hours of debugging and scratching my head! I cant believe a plug-in like this exists. What is WordPress’s reasoning behind not fixing this. There has to be a good reason.

    1. It’s not a bug, it’s the way WordPress is designed to work. This plugin just lets you disable it if you don’t want it to work that way.

  20. I love this plugin. It put an end to a lot of frustration when I was designing the layout to specific pages on my site. But now I’m noticing all the breaks in my blog posts are being removed so they end up being posted as one long block of text. Is there a way to keep the plugin working for the rest of the site, while allowing paragraph breaks in the blog post?

  21. Works great on posts, but still adding p tags in my category pages. I’m using CSS to customise the category listings, but those paragraph tags persist, so if I add a heading tag or anything, it ends up in a p tag.

    Any thoughts?

  22. There is a big problem with this plug in, when you toggle between Visual and HTML all the P tags and breaks disappear, this is very annoying and causes problem. All of my web admins prefer to edit in visual mode and when they touch this, everything breaks a part. you can’t expect us not to use p tag and brakes. Is there anyway to make this plug in a bit smarter that this?

  23. Hi, this plugin works at removing the tags but I noticed that there are quotes in the source code around the text now instead of the tags. Do you know why this is happening and how to get rid of them?

  24. Ok, I love.. and hate , this plugin.
    Is there a way of targetting specific parts of my site? Where I want to apply this in?

    Or could someone tell me, how to style blocks of text now?

    Im clueless….

  25. Hello,

    Does anyone know how I can strip the tags from my wordpress code while keeping the line breaks? I don’t want to disable wpautop completely because that way I’d lose both, just want to edit it to remove the paragraph tags while keeping the line breaks.

    Can someone help me out?

    Thnx!

Leave a comment

Your email address will not be published. Required fields are marked *