Removing “wpautop” (auto tags) only on certain pages?

I’m using the remove_filter in functions.php to remove the auto insertion of

and
tags on my wordpress site.

remove_filter( ‘the_content’, ‘wpautop’ );
remove_filter( ‘the_excerpt’, ‘wpautop’ );

But one of our pages (wiki) is being dynamically created and to make a long story short, it relies on the

tags.

How and where should I write an if statement that targets only certain pages to apply the remove_filter to?

I’ve tried placing this code in the both the functions.php, front-page.php, and page.php files but nothing seems to work.

<?php if ( !is_page( ‘wiki’) ) {
remove_filter( ‘the_content’, ‘wpautop’ );
remove_filter( ‘the_excerpt’, ‘wpautop’ );
} ?>

Read more here:: tags) only on certain pages?” rel=nofollow>Removing “wpautop” (auto

tags) only on certain pages?

Leave a Reply

Your email address will not be published. Required fields are marked *