Disable WordPress autop
Back when I first started this blog, and in turn using WordPress, the most annoying part of blogging was WordPress' auto-formatting. WordPress would strip out custom attributes, mess with my DIV and paragraph structure, and just generally raise havoc. It bugged me so much that since the inception of this blog, I've been creating the HTML for blog posts myself. That did, however, require turning off
autop -- the filter that normally formats post content. To turn off the
autop filter, simply add this PHP snippet to your theme's
remove_filter call could save you a word of trouble with formatting that seems out of your hands. If your WordPress blog uses multiple themes and you'd prefer to add this functionality as a plugin, you can place the following within a PHP file to be placed in the
/* * Plugin Name: Disable autop * Author: David Walsh * Author URI: http://davidwalsh.name/ * Plugin URI: http://davidwalsh.name/disable-autop * Version: 0.1 * Description: Disable WordPress' horrible automatic formatting */ remove_filter('the_content', 'wpautop');
This would also be helpful if you would prefer to use Markdown to write posts, as you could convert the Markdown with a different plugin or by yourself within each theme file.