WordPress: Remove all shortcodes from the content
Shortcodes are great for adding various functionalities. For instance, you can add any custom text with content or include some styling. Shortcodes can have make blogging fast for advanced users, but what if you have a shortcode that you want to disable on a specific pages, say, the homepage. To disable the short code on other pages, change the condition is_home to the desired one.
function disable_shortcode($content) { if ( is_home() ) { $content = strip_shortcodes($content); } return $content; } add_filter('the_content', 'disable_shortcode');