46 posts
  • Has been part of the Envato Community for over 2 years
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+2 more
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!

1001 posts It's in the pipeline!
  • Has sold $500,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Sells items exclusively on Envato Market
+7 more
purethemes says
46 posts
  • Has been part of the Envato Community for over 2 years
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+2 more
MonkeeThemes says
391 posts
  • Located in United States
  • Power Elite Author: Sold more than $1M on Envato Market
  • Has sold $1M+ on Envato Market and is now a Power Elite Author
  • Made it to the Authors' Hall of Fame
+4 more
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');
1001 posts It's in the pipeline!
  • Has sold $500,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Sells items exclusively on Envato Market
+7 more
purethemes says

@WPExplorer

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

255 posts
  • Has sold $10,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Has been part of the Envato Community for over 2 years
  • Sells items exclusively on Envato Market
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
  • Has been part of the Envato Community for over 2 years
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+2 more
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
  • Has been part of the Envato Community for over 2 years
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+2 more
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.

357 posts
  • Has been part of the Envato Community for over 2 years
  • Has referred 1+ members
  • Has sold $40,000+ on Envato Market
  • Sells items exclusively on Envato Market
+1 more
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.
2445 posts
  • Has referred 100+ members
  • Has sold $100+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+3 more
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