user1359872
user1359872

Reputation:

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');

Upvotes: 2

Views: 1892

Answers (1)

The Alpha
The Alpha

Reputation: 146201

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.

Upvotes: 3

Related Questions