Title: Why does wpautop wrap html comments?
Last modified: September 1, 2016

---

# Why does wpautop wrap html comments?

 *  [Simba](https://wordpress.org/support/users/simbalion/)
 * (@simbalion)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/why-does-wpautop-wrap-html-comments/)
 * If I put an html comment on a blank line in the text editor, wpautop wraps it
   in paragraph tags. Is this intentional? If so, is there a good explanation? If
   not, can it be fixed in a way that doesn’t get over-written with every update?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Metallicarosetail](https://wordpress.org/support/users/metallicarosetail/)
 * (@metallicarosetail)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/why-does-wpautop-wrap-html-comments/#post-7593288)
 * Hi SimbaLion,
 * You may try it. Add below code inside functions.php anywhere
 *     ```
       remove_filter( 'the_content', 'wpautop' );
       remove_filter( 'the_excerpt', 'wpautop' );
       ```
   
 * Visit codex link which will help you.
    [https://codex.wordpress.org/Function_Reference/wpautop#Disabling_the_filter](https://codex.wordpress.org/Function_Reference/wpautop#Disabling_the_filter)
 * Thank you
 *  Thread Starter [Simba](https://wordpress.org/support/users/simbalion/)
 * (@simbalion)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/why-does-wpautop-wrap-html-comments/#post-7593292)
 * I know how to get rid of wpautop, I should have been clear in my question. Is
   there a way to preserve wpautop functionality, but eliminate the broken behavior
   of wrapping invisible HTML comments in paragraph tags?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Why does wpautop wrap html comments?’ is closed to new replies.

## Tags

 * [wpautop](https://wordpress.org/support/topic-tag/wpautop/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Simba](https://wordpress.org/support/users/simbalion/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/why-does-wpautop-wrap-html-comments/#post-7593292)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
