Based on your comment clarifying what you want to achieve, it appears you want to display the first 60 characters of your post not including any shortcodes.
To do this you can use the strip_shortcodes()
function. Rewritten with that, your code will look like this:
$content = strip_shortcodes(get_the_content());
$content = apply_filters('the_content', substr($content, 0, 60) );
$content = str_replace(']]>', ']]>', $content);
echo $content;
All we’re doing here is running the content (from get_the_content()
) through strip_shortcodes()
before applying WordPress filters on the first 60 characters.
Depending on what you want to achieve and whether you’re relying on any other plugins modifying this content for you, you actually might be fine to skip the apply_filters()
call as well – in which case all you’d need to do is set $content
to the substr()
you want to have.