WordPress.org

Ready to get started?Download WordPress

Forums

RFE: option for not converting breaks. (4 posts)

  1. halcanary
    Member
    Posted 10 years ago #

    I currently have a Movable Type blog and would like to switch over to WordPress.
    One thing holding me back is that MT has an option "Text Formatting: None" which allows me to write all of my posts in html. This disables the conversion of line breaks into <br/> and gives me control over how my text looks.

  2. Scott Reilly
    WordPress & Plugin Dev
    Posted 10 years ago #

    You can use the following to disable ALL automatic post formatting performed by WordPress by using the plugin below. Copy-n-paste everything from <?php to ?> (inclusive), save it to no-post-formatting.php in your wp-content/plugins/ directory and activating the plugin via the Admin->Plugins interface. Ensure you do not have any spaces/characters before <?php or after the ending ?>. 'wpautop' is really the filter you want removed to disable, but if you want the post to be EXACTLY as you input it, then this should do it. Also, you may also want to turn off these two settings in your Admin page -> "Options" page -> "Writing" submenu (since they may also modify your post):
    Convert emoticons like :-) and :-P to graphics on display
    WordPress should correct invalidly nested XHTML automatically
    <?php
    /*
    Plugin Name: No Post Formatting
    Version: 0.1
    Plugin URI: http://www.coffee2code.com/wp-plugins/
    Author: Scott Reilly
    Author URI: http://www.coffee2code.com
    Description: Disable all automatic post formatting.
    */
    remove_filter('the_content', 'wpautop');
    remove_filter('the_content', 'wptexturize');
    // 'convert_chars' won't modify your post noticably, so not turning it off
    //remove_filter('the_content', 'convert_chars');
    ?>

  3. halcanary
    Member
    Posted 10 years ago #

    Cool. Thanks. The modification I made to do the same thing was a bit of a hack. This is much better.

  4. ext212
    Member
    Posted 8 years ago #


Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.