Cornerstone Preview Issue / closing HTML tag

Hi,
I’ve already asked this question before and we couldnt find a solution that time, then the topic was closed etc.
So now on a fresh installation with only Yoast SEO Plugin active, the error message appears and I dont get a preview in Cornerstone.
This really annoys me because it happens on all my 15 client websites with X theme… Would you please take a look in my backend?

Hi @cndrk,

I’ve installed the SEO Yoast plugin on my local installation but couldn’t replicate this issue.

Could you please try dowgrading the version of SEO Yoast plugin(maybe the version 9.2 or older) to check if the issue is gone?

Let us know how it goes!

Hi,
I am having this issue since last year. My other topic was created on September 2018 (https://theme.co/apex/forum/t/yoast-seo-causing-cornerstone-error-preview-html-does-not-include-a-closing-tag/43371). Since then, there was many updates to Yoast plugin and X theme. But this issue never disappeared. So I am 100% sure that it isnt related to a version of Yoast.
I have some custom code in my functions.php and .htaccess files. maybe this is somehow relevant?

Hi @cndrk,

I’ve removed this custom code and the issue has gone:

if (defined('WPSEO_VERSION')){
  add_action('get_header',function (){ ob_start(function ($o){
  return preg_replace('/\n?<.*?yoast.*?>/mi','',$o); }); });
  add_action('wp_head',function (){ ob_end_flush(); }, 999);
}

Thank you for understanding.

Of course. But I didnt know the problem was because of my custom code.
Thank you very much, you saved me lots of long lasting pain :slight_smile:

On behalf of my colleague, you’re welcome. Cheers! :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.