WordPress.org

Ready to get started?Download WordPress

Forums

Possible feature: disable auto-formatting? (10 posts)

  1. Bertha
    Member
    Posted 9 years ago #

    Hi there! I'm loving WordPress since I moved over from Moveable Type. About the only thing MT had over WP was the ability to turn off the auto-formatting. I just find it easier to put my own HTML codes in my posts, especially if I'm going to include a picture or goofy effect.

    I haven't found a way to disable the auto-formatting in WP. Am I just overlooking something obvious, or is that really not an option?

  2. RustIndy
    Member
    Posted 9 years ago #

    In the site admin area, go to the Options menu, then Writing - it's the 3rd option down - just uncheck the things you want unchecked :)

  3. Yngwin
    Member
    Posted 9 years ago #

    That's only a small part of it, RustIndy. It doesn't turn off the wpautop function (automatic paragraphing).

    You can try commenting out the lines
    add_filter('the_content', 'wpautop');
    ...
    add_filter('the_excerpt', 'wpautop');

    in the beginning of wp-includes/template-functions-post.php

  4. Nick Momrik
    Member
    Posted 9 years ago #

    Although commenting out those lines will work, when you upgrade later, they'll just be there again. A nice approach would be to create a simple little plugin using
    remove_filter('the_content', 'wpautop');
    remove_filter('the_excerpt', 'wpautop');

    That way you can easily turn them on and off by activating/deactivating the plugin.

  5. Bertha
    Member
    Posted 9 years ago #

    Interesting, I only have two options--one for converting emoticons to graphics, and one for correcting invalidly nested XHTML. I'm using 1.2.2. Was this a plugin?

  6. Nick Momrik
    Member
    Posted 9 years ago #

    Bertha.... try pasting this code into a file, say call it disable-wpautop.php and upload it to your plugins folder, then activate it through the plugin section of the admin.

    <?php
    /*
    Plugin Name: Disable WPAUTOP
    Version: 1.0
    Plugin URI:
    Description: Disables the wpautop function for the_content and the_excerpt.
    Author: Nick Momrik
    Author URI: http://mtdewvirus.com/
    */
    remove_filter('the_content', 'wpautop');
    remove_filter('the_excerpt', 'wpautop');
    ?>'

    Make sure not to have any blank lines/spaces before <?php or after ?>`

  7. Yngwin
    Member
    Posted 9 years ago #

    That's a good idea MtDewVirus. I may actually use that myself!

  8. Bertha
    Member
    Posted 9 years ago #

    MtDewVirus--that worked! Thank you thank you thank you! *kisses feet*

  9. Nick Momrik
    Member
    Posted 9 years ago #

    You're welcome. Glad to hear it worked. :-)

  10. Nick Momrik
    Member
    Posted 9 years ago #

    Plugin has been added to the WP Plugin Repository...

    http://dev.wp-plugins.org/browser/disable-wpautop/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.