• I’ve built a custom word count script that is supposed to return the Word Count of the post. I’m trying to get it to remove shortcodes, but when I add the strip_shortcodes function, it removes everything between the shortcodes and not just the shortcodes themselves. Below is my script:

    function ic_word_count() {
        global $post;
        return str_word_count( strip_tags( strip_shortcodes( $post->post_content ) ) );
    }

    Any ideas?

  • The topic ‘Strip Shortcode function not working?’ is closed to new replies.