Disable autop in WordPress

If the automatic paragraph seems annoying to you, you can disable or remove it from the content or excerpt view from a WordPress site.

Add the following codes to your site via child theme‘s functions.php file. If you don’t have a child theme, consider to create a custom functions plugin for your site.

Remove autop from the content view:

remove_filter('the_content', 'wpautop');

Remove autop from the excerpt view:

remove_filter('the_excerpt', 'wpautop');

Remove autop from content & excerpt both:

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

Leave a Reply