46 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 2-3 years
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
  • United Kingdom
MonkeeThemes says

Hey guys,

remove_filter seems to be bad practice as it might break other plugins from working. Do you know any other solution to remove p tags to appear before and after the content page?

Thanks!

990 posts It's in the pipeline!
  • Elite Author
  • Exclusive Author
  • Europe
  • Has been a member for 5-6 years
  • Bought between 100 and 499 items
  • Referred between 200 and 499 users
  • Envato Studio (Microlancer) Beta Tester
+2 more
purethemes says
46 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 2-3 years
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
  • United Kingdom
MonkeeThemes says
390 posts
  • Power Elite Author
  • Power Elite Author: Sold between 1 000 000 - 1 999 999 dollars
  • Referred more than 2000 users
  • Bought between 500 and 999 items
  • Has been a member for 4-5 years
  • Exclusive Author
  • United States
WPExplorer says

This is what I use:

function wpex_clean_shortcodes($content){   
    $array = array (
        '<p>[' => '[', 
        ']</p>' => ']', 
        ']<br />' => ']'
    );
    $content = strtr($content, $array);
    return $content;
}
add_filter('the_content', 'wpex_clean_shortcodes');
990 posts It's in the pipeline!
  • Elite Author
  • Exclusive Author
  • Europe
  • Has been a member for 5-6 years
  • Bought between 100 and 499 items
  • Referred between 200 and 499 users
  • Envato Studio (Microlancer) Beta Tester
+2 more
purethemes says

@WPExplorer

really? on your themes here? I was rejected for this twice.

255 posts
  • Sold between 10 000 and 50 000 dollars
  • Has been a member for 2-3 years
  • Exclusive Author
  • Bought between 1 and 9 items
PersianArt says

and what is your Idea about this

remove_filter( 'the_content', 'wpautop' );
add_filter( 'the_content', 'wpautop' , 99);
add_filter( 'the_content', 'shortcode_unautop',100 ); 
46 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 2-3 years
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
  • United Kingdom
MonkeeThemes says

This is what I use:
function wpex_clean_shortcodes($content){   
    $array = array (
        '<p>[' => '[', 
        ']</p>' => ']', 
        ']<br />' => ']'
    );
    $content = strtr($content, $array);
    return $content;
}
add_filter('the_content', 'wpex_clean_shortcodes');

I have done the same thing at the end, thanks WPExplorer

46 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 2-3 years
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
  • United Kingdom
MonkeeThemes says

and what is your Idea about this
remove_filter( 'the_content', 'wpautop' );
add_filter( 'the_content', 'wpautop' , 99);
add_filter( 'the_content', 'shortcode_unautop',100 ); 

It should not be an issue as you are putting it back but I still wouldn’t touch the wp core even though it’s cleaner… not sure it would be accepted. Post back to confirm if it is.

356 posts
  • Exclusive Author
  • Has been a member for 2-3 years
  • Malaysia
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
billyf says


and what is your Idea about this
remove_filter( 'the_content', 'wpautop' );
add_filter( 'the_content', 'wpautop' , 99);
add_filter( 'the_content', 'shortcode_unautop',100 ); 
It should not be an issue as you are putting it back but I still wouldn’t touch the wp core even though it’s cleaner… not sure it would be accepted. Post back to confirm if it is.
I don’t think the reviewers would allow that. Last time my theme was soft rejected because of that code.
2444 posts
  • Has been a member for 5-6 years
  • Exclusive Author
  • Europe
  • Bought between 10 and 49 items
  • Referred between 100 and 199 users
  • Sold between 100 and 1 000 dollars
  • Envato Studio (Microlancer) Beta Tester
digitalimpact says

@WPExplorer really? on your themes here? I was rejected for this twice.

Interesting to hear. Requested staff reply for this.

by
by
by
by
by
by