• I realize that there are two plugins that disable the automatic formatting on an individual entry basis (Mime and WP Unformatted), but I’d like to set it to be off globally and don’t really care if there’s an option to turn it on or not — at least at this point.
    I tried simply making a tiny php plugin with this code:
    <?php
    /*
    Plugin Name: Disable Formatting
    Version: 1.0
    Plugin URI: http://elasticdog.com/
    Description: Switches wpautop formatting off for all entries.
    Author: Aaron Schaefer
    Author URI: http://elasticdog.com/
    */
    remove_filter('the_content', 'wpautop');
    ?>

    …but when I try to edit and save an entry, I get a “Cannot modify header information” error:

    Warning: Cannot modify header information – headers already sent by (output started at /home/elasticd/public_html/wp/wp-content/plugins/disable-formatting.php:1) in /home/elasticd/public_html/wp/wp-admin/post.php on line 340

    Am I missing something obvious?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Is there a space or carriage return after the last ?>

    Thread Starter elasticdog

    (@elasticdog)

    Yes, there was a return after the last ?>, which I have now removed, but I’m still getting the same error.
    I vaguely remember reading about an extra space or return after the php ending, and notice that other plugins don’t have one, but most of the php code for WP itself does…is this a requirement for plugins only?
    Any other ideas what could be causing the error?

    yes it’s for plugin. i had the same problem. once i removed the white space, the error is gone. so i guess yours has more problem..

    no i had that trouble when i was testing my first plugin. and i email the hackers list and they said it’s because of the white space. after i got rid of it, it works. it’s possible you need to add_filter or add_action at the bottom for it to work. why don’t you read a dummy function and try??

    Thread Starter elasticdog

    (@elasticdog)

    That is EXTREMELY weird…just for giggles, I tried a different approach. I knew that the Unformatted plugin worked, and so I installed it and slowly took away the lines of code I didn’t need. Once I took away all of those and tested it along the way, I started adding my own info and what I needed until I had pretty much the exact same file as before, but for some reason, the new one works.
    Thanks for all your suggestions!

    Huh. Your version worked perfectly for me just now. Long time gone now, but thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Disable wpautop Formatting?’ is closed to new replies.