Disable wpautop Plugin

Jun 13, 2006 | Tags: , , | Written by Administrator

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.zip
  • 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.

Share This

Comments

  1. Mark :

    Oct 9, 2006 3:59 am

    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. Jeff Golenski :

    Feb 3, 2007 11:38 pm

    My friend, you just saved my life.

  3. Scott Clark :

    Feb 12, 2007 7:10 pm

    Excellent plug-in. The auto P tag was driving me crazy. Thanks for taking the time to fix the problem.

  4. wildframe :

    Feb 23, 2007 11:07 pm

    Same here for me--doesn't work! I'm on 2.1.1.

  5. shockomotive :

    Feb 24, 2007 10:58 pm

    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.

  6. author
    Cutout :

    Mar 12, 2007 11:01 am

    No dice on WP 2.1.1. Any chance of an upgrade?

  7. John (author) :

    Mar 14, 2007 5:07 am

    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?

  8. author
    Cutout :

    Mar 14, 2007 10:54 am

    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.

  9. Manu :

    Apr 21, 2007 5:29 pm

    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.

  10. Manu :

    Apr 21, 2007 5:31 pm

    Installed the p and then checked the cde WP was applying to the paragraphs using the AardVark extension in FF (https://addons.mozilla.org/en-US/firefox/addon/4111). It says "p class para". the is no para class in my CSS.

  11. John (author) :

    Apr 27, 2007 12:44 am

    Manu, this plugin doesnt change a post at all, just how it is displayed. I don't know what you mean by 'p class para'

  12. Rob Cooper :

    Jun 28, 2007 10:41 am

    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

  13. John (author) :

    Jun 28, 2007 8:32 pm

    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!

  14. Scott Bernadot :

    Jul 7, 2007 4:10 am

    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!

  15. Stefan :

    Jul 19, 2007 3:45 am

    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!

  16. Yeago :

    Aug 18, 2007 4:59 pm

    In the event that you don't want to disable wpautop entirely...

  17. Yeago :

    Aug 18, 2007 5:00 pm

    http://yeago.net/works/problem-issue-with-wordpress-messing-up-html-with-p-and-br-tags

    ...woops. Must not understand the a tag as well as I thought. =)

  18. mandarine :

    Jan 2, 2008 3:16 am

    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.

  19. Scott Lenger :

    Jan 15, 2008 5:23 pm

    Nothing beats a plugin with a total of two lines of code, I like it. Thanks for keeping it short and simple.

  20. author
    shockwheat :

    Feb 2, 2008 3:27 pm

    Great plugin. You saved me a lot of headaches. Thank you.

  21. jessie :

    Mar 21, 2008 2:47 am

    I will use this plugin in my wordpress blogs. I really find the auto format of WP annoying at times. i hope this will help. thanks.

  22. Mike :

    May 28, 2008 5:02 am

    Thank you very much!

    This is a lifesaver, the default behaviour was driving me mental!

    Cheers

  23. bali :

    Jun 11, 2008 2:22 pm

    I have problem with for long. Now I hope this solve my problem

  24. Alex Dergachev / Evolving Web :

    Jul 19, 2008 6:25 pm

    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.

Pings & Trackbacks

bajor.biz, blog.duskfalls.org, chanto-web.net, entirelysafeandfun.com, geniusone.com, kan2.jp, mfields.org, mikeschinkel.com, rationalpatterns.net, tech.cowchihuahua.com, blue-anvil.com, cywhale.de, internet-solutions.si, moushigo.com, onethingnew.com, scratch99.com, tv-game.jp, wordpresscn.com, yeago.net, yokogo.main.jp

Leave a comment


XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Home | Software | Terms & Conditions | Sitemap | John Godley © 2008
Close
E-mail It