Get and Trim Full Post Content in WP Query

I think the best thing to do would be to just simplify what you’re doing. I’d just do something simple with it if all you’re attempting to do is trim the amount of characters output. I’d use mb_strimwidth to trim the characters, and within that run wp_strip_all_tags() on get_the_content(). Like this:

$content = mb_strimwidth(wp_strip_all_tags(get_the_content()), 0, 100, '...');
echo $content;

Edit: Forgot to note that if you’re going to have shortcodes in your content, which I highly recommend against, you may also have to wrap get_the_content() with strip_shortcodes().

tech