Support » Fixing WordPress » disable wpautop – tried plugins and remove_filter

  • Hello,

    I cannot for the life of me disable the wpautop function in my theme. I have tried various plugins and also this:

     * Roots functions
    remove_filter( 'the_content', 'wpautop', 30 );
    remove_filter( 'the_excerpt', 'wpautop', 30 );
    remove_filter( 'comment_text', 'wpautop', 30 );
    if (!defined('__DIR__')) { define('__DIR__', dirname(__FILE__)); }
    require_once locate_template('/lib/utils.php');           // Utility functions
    require_once locate_template('/lib/config.php');          // Configuration...

    in my theme functions.php

    Is there something I am doing wrong. I have disabled it successfully on other themes, but I know roots and bootstrap is set up a little differently.

    The extra <p> tags are driving me insane, especially as I will be passing this to a client soon and they will be using the visual editor edit, thus screwing up the other handwritten code…

    Any help would be brilliant. As always time out to help is greatly appreciated.



Viewing 1 replies (of 1 total)
  • It seems you don’t need to add priority when removing this filter for the_content and the_excerpt. Example from the Codex also doesn’t have it.

    It happen that visual editor also adding and saving <p> into a post content. Check if there is no extra p in a post content (text editor mode).

    As an option, try Disabler plugin.

Viewing 1 replies (of 1 total)
  • The topic ‘disable wpautop – tried plugins and remove_filter’ is closed to new replies.