WP-No-Format WordPress Plugin (Prevent HTML Code Formatting/Modification)

For the ones used to work with WordPress editor’s HTML mode and hate when it creates <p>s and reorganize <br/>s on its will (among other things), I’ve made this plugin.

I’ve been searching a lot for this kind of functionality and, since I couldn’t find any plugin which let you decide which parts of the code you’d want to leave “unformatted”, I started to write my own…

WP-No-Format

It’s very simple to use. After activating it, you can just type:

<!-- noformat on -->

on the WordPress editor, just before the part you want to protect, and from that point on, WordPress won’t touch the HTML code you write.

If you want to resume the standard “formatting” you have to type:

<!-- noformat off -->

And that’s all!

GNU GPL v3 WP-No-Format is licensed under the GNU GPL v3 (attached)…

Update (version 1.1): added convert_chars function support. Before, some characters got converted to HTML entities (for example, when writting “&&” appeared as “&#038;&”). [Update recommended]

Here is the change log.

Latest WordPress version tested with: 2.8.4

Support appreciated!

All the content offered in this website is, except noted otherwise, of free nature. This means you can share it wherever you want if you do it freely and stating its source.

If it was useful for you and you’d like to contribute, you can make a donation or, at least, visit one of our advertisers of your choice; they are all around the site.

Incoming search terms for the article:



34 Responses to “WP-No-Format WordPress Plugin (Prevent HTML Code Formatting/Modification)”


  • This is my favourite plugin. I had a textarea containing the code for a flash object for people to copy into their pages and wordpress fucked up my code and gave people avery long code that didn’t work.
    This should come with wordpress by default:
    [no_fucking_with_the_code] … [/no_fucking_with_the_code]

    Thank you very much!

    • Hi Liviu G!
      Thanks for you comment! I’m very pleased you liked the plugin!
      I had a very similar problem and couldn’t understand why no one had done something like this.
      Now we can write our code in peace…
      :)

  • Wow, really like this, very simple

  • Unfortunally on my theme “deluxe theme” not working ?
    Can you help me ?
    Tk

  • I installed your plugin to solve a problem with a particular post. When I look at the information saved to the database, it looks all right. But then in the page source, blam! br tags everywhere (and the “noformat on” comment stripped out).

    I’m not using qTranslate, so that easy answer is out.

    I’d be happy to send you the text from the database (a big chunk of XML data in the middle of the post) and the resulting page source if that would be helpful. I’m running WordPress 2.8.4

    • Hi Jerry!

      Thanks for your comment!

      I assume you’re typing everything in the HTML mode of the editor, so there should be no problem…
      Please send me the complete text you’re having problems with, via the “Contact” section of the site… If you wish, you can take it out from the DB so it is as cleanest as possible…
      By the way, have you ever installed any similar plugin to the WP-No-Format? If it’s possible, could you send me the list of plugins you’re using?
      That’s all!
      I’ll see how we can solve this!
      Greetings!

      NeoEGM.

      • I just sent the data, then realized I needed to send you a list of my plugins. At the top of the list was Advanced Fancybox, a lightbox photo gallery plugin. “I never use that,” I thought, and disabled it.

        Hey, presto! The evil line breaks disappeared. A lucky accident has saved us some work! I love when that happens.

        Thanks for your swift response, but I now think the problem lies with them. It seems an odd thing for a lightbox plugin to be messing with, but there you have it.

        • Hi Jerry!

          I was just about to test what you sent me and got your comment!
          I suspected it had something to do with your plugins since I’ve been using it for a long time by now and it’s been working without any kind of problem…
          I’m very glad you solved your problem!
          I’m here for any further comment, problem or suggestion you may have!
          Enjoy it :)

          NeoEGM.

  • I am trying to get this code in, but no luck. It does not show up when I access the web page. Does this only work for posts or every HTML editor (i.e. Pages) in WP? Any ideas?

    Thanks.

    • Hi GC!

      Effectively, the WP-No-Format plugin works with posts and pages…

      I’ve not found ANY code that doesn’t work with the plugin… What code are you trying to post? I’ve not received any in your comment…

      Please post it here (or via the Contact section if it’s very long) and tell me what’s wrong with what you get and your complete plugin list…

      I’ll be waiting for your answer…

      NeoEGM.

  • Hi I have was setting up a website and I was using your no format plugin. Everything was going fine but now when I switch between visual and html, Im losing my page breaks Have you any other reports of this. I am not using any special code just divs and styles.

    Cheers

    • Hi Paddy!

      The WP-No-Format plugin does not touch the page breaks at all while editting the posts/pages. It just ensures they won’t get removed when you visualize them, if you put the corresponging “noformat” tags.

      On the other hand, the Visual editor is not made for working with HTML mode. It does not really work well while switching between modes and lots of plugins make it break your code completely (for example, the qTranslate plugin toches the line breaks while switching between languages).

      If you want have control of your code, I’d recommend you to either disable the WYSIWYG editor or, if you can’t do that (for example, if you use qTranslate), at least, hide its tab.

      If you need further information, just tell me.
      Hope it helps!

      NeoEGM.

  • I am trying to use your plug-in so that I can put MAP data in my posts. WordPress auto adds to all my areas so it screws it up.

    It still does that after using your plug-in.

    Any help?

    • Hi Charles!

      The WP-No-Format plugin works perfectly for that kind of cases…

      Have you added the <!-- noformat on --> and <!-- noformat off --> tags surrounding your code in the HTML mode?

      If you have done it and it still doesn’t work, send me a list of your enabled plugins and the exact code you’re trying to post via the Contact form.

      Hope it helps!

      NeoEGM.

  • Hi there, is there any way to get this kind of functionality on WordPress.com? I use lots of tabs to indent HTML tags (as it was some kind of source code) and I really don’t like the idea of losing it all…

    • Hi dovefight!

      What are you having problems with? With the re-formatting of the HTML code while editing posts or with the reformatting while displaying?

      This plugin is made for the second case…

      WordPress.com rewrites most of your HTML code each time you save a post… And I don’t really know if there’s anything you can do about that, I’ve not used WordPress.com since it’s not customizable enough for me…

      If you’re expecting to be able tu customize those kind of things, I’d recommend you to move to your own installation of WordPress in your own hosting space…

      There are very cheap plans and even free ones…

      Try to search for:

      free hosting php mysql

      If you have your own WordPress installation, you can customize everything at your will: install your own plugins, themes and everything you want…

      You can then move your entire blog (posts+comments) to your new installation…

      Hope it helps!

      NeoEGM.

  • Man, I love a plugin that is simple and direct and does one thing well, like yours. I have a request for a (hopefully) simple addition.

    It starts with a wordpress bug (http://core.trac.wordpress.org/ticket/2691) that is putting incorrect formatting around HTML comments. I am using a plugin that adds stuff at the end of every post, and they conscientiously bracket their added stuff with comments, which then become paragraphicated.

    Would it be possible for you to add a feature (or create a separate plugin) that would block automatic formatting of all content added by other plugins? It would essentially add a marker immediately following the post, before other plugins add their stuff (like social bookmark plugins, for instance).

  • What a great and useful plugin! Going to apply it to several of the blogs I work on right now. I’ve seen other plugins out there that remove all auto formatting, but you can’t pick and choose from where, which is all I want. Thank you!!

    By the way, I notice that you have customized your commens so that your own comments appear differently. I’ve found numerous plugins that enable me to do that, but none that work alongside with comment reply. I see that you have successfully achieved this. Did you use a plugin? May I ask what plugin? It looks great!

    • Hi Abi!

      Thanks for your comment!
      I’m glad the plugin was helpful for you :)

      On the other hand, I must tell you that the specific customization for my comments you’re talking about is just as the K2 theme comes out of the box, so you can download it and check its code in order to port it to your own themes… Other option, is to look for a plugin which does that (which should probably exist)…
      Hope it helps!
      Greetings.

      NeoEGM.

  • Hey, nice idea, I tried it on WP vers 3.0 but it doesn’t work. The no format tags get wrapped in a tag and the code between dissappears. Will you be updating it? I would be happy to pay for something this good if it works around this rotten problem!

  • Edited the last post:

    I have had no luck getting this to work with a google checkout donation button. Google creates a javascript.

    I have tried adding all code to the donation page.

    I have also tried putting the javascript call separately in the header.php and leaving the other code on the page wrapped inside the noformat code.

    I am stumped.

    These are the plugins I have installed
    Akismet
    All in One SEO Pack
    Blog Protector Final
    Broken Link Checker
    Collision Testimonials
    Embed Iframe
    Enhanced Paypal Shortcodes
    Fast Secure Contact Form
    flickr-slideshow-wrapper
    Flickr Gallery
    Google AJAX Translation
    Google XML Sitemaps
    Insere Iframe
    Keyword Statistics
    Onbile
    Ozh’ Admin Drop Down Menu
    PayPal Framework
    Redirection
    Search Everything
    Search Meter
    Secure WordPress
    Sociable for WordPress 3.0
    Social Media Widget
    TinyMCE Advanced
    Universal Post Manager
    Velvet Blues Update URLs
    Viper’s Video Quicktags
    Web Invoicing and Billing
    WordPress Importer
    WordPress PayPal Donation
    Wordpress PDA & iPhone
    WP-Table Reloaded
    Donate
    WP Paypal Donation

  • I couldn’t find any information on whether this plugin supports php5. I was planning on upgrading my server to php5 from php4 but didn’t want to break my site without checking. Thanks in advance.

  • Hi!

    I have made a combination of Multiple Content Block and the “NivoSlider light” plugin to easily manage galleries in pages:

    (example: http://www.sanaryvilla.fr/)
    With this code, all i would have to do is inserting images in my WYSIWYG to create a pretty slideshow…if only auto tags were disabled for this particular bloc!

    Thanks to your plugin, now it works!

    But, as a php newbie, i have a new question: is it possible to put directly the functionality in my template.php, for a particular bloc ? (I am working on a bigger project with slideshows in many pages and I would be really glad if I didn’t have to put in each “slideshow bloc”. (sorry for my bad english, I hope I was clear enough…)

  • Hello. I know these posts are old, but is this working for the latest version of WP? Also, can it work on just one page?

Leave a Reply