WordPress adds empty <p> tags after HTML comments

I have found multiple posts on stackoverflow regarding how to fix this but none of them work. I have the Karma theme and wp-ecommerce. All the <!-- html comments !--> are being wrapped by <p> tags by WordPress.

These do not seem to work within my functions.php file.

remove_filter( 'the_content', 'wpautop' );
remove_filter('the_content', 'wptexturize');

Related posts

Leave a Reply

1 comment

  1. According to Codex the following should work

    remove_filter( 'the_content', 'wpautop' );
    remove_filter( 'the_excerpt', 'wpautop' );
    

    But, as you said it’s not working so alternatively you can use NoAutoP or No WPautop plugin to remove the p tags. Hope these will work for you.

    You can read this answer too, may be it’ll be helpful to you.