Remove WordPress AutoP Filter

WordPress will automatically insert <p> and </p> tags for you to separate content breaks within a post or page. If, for some reason, you want or need to remove these, you can use either of the follow code bits.

Use this code just for your theme

remove_filter('the_content', 'wpautop');

Use this code as a plugin

<?php
/* Plugin Name
 * Plugin URI: http://wpvibe.com
 * Author: Jonathan Dingman
 * Author URI: http://jonathan.vc
 * Version: 1.0
 * Description: Disables the <p> that is automatically inserted by WordPress
 */

remove_filter('the_content', 'wpautop');

?>

If you want to use the one line of code in your functions.php, it will work only for that theme. So, if you change themes, you will need to make sure to bring that code with you if you still need it. If you want to always have the filter removed, use the plugin and it will always work as long as the plugin is activated.

Get involved, Vibe with us.

No Vibes for this post.

Powered by WP Hashcash