Languages: English • Italiano • Reference/strip shortcodes 日本語 (Add your language)
Deletes all shortcode tags from the given content.
<?php strip_shortcodes( $content ); ?>
When viewing posts 'home' page, strip all shortcodes, but on other pages, such as single.php, do not strip the shortcodes.
function remove_shortcode_from_index( $content ) { if ( is_home() ) { $content = strip_shortcodes( $content ); } return $content; } add_filter( 'the_content', 'remove_shortcode_from_index' );
Since: 2.5
strip_shortcodes() is located in wp-includes/shortcodes.php
.