WordPress Yoast SEO plugin Post Save/Update Issue

The Solution

After WAY more research than I cared for and ultimately not getting a straight answer, I started to realize that the custom shortcode I was using to create HTML might be to blame. I was creating content by closing the <?php tag and reopening it after the html was finished. Turns out, I should have been using an output buffer like ob_start()/ob_get_clean() and returning the code instead.

Before:

if (argument > 0) {
?>
<p>Some text</p>
<?php
}

After:

if (argument > 0) {
ob_start();
?>
<p>Some text</p>
<?php
return ob_get_clean();
}

This returns the buffered HTML and allows any filters or echos to take place on the shortcode properly. Once this change was made, Yoast (and a couple others like Relevanssi) started working as they were intended to.

Now it’s possible that you might get the same debug errors for other reasons, but in this instance, it boiled down to my custom theme not producing shortcodes correctly.