You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to remove the comments by doing a regular expression search like the following in function.php, line 347
// Strip out gutenberg comments from mainEntityOfPage
$gutenberg_comments_pattern = '/<!--\s+(\/)?wp:[a-z\-]+(\s+(\{.*?\}))?\s+-->/';
$no_comments_webpage = preg_replace($gutenberg_comments_pattern, "", $webpage['@id']);
$output['mainEntityOfPage'] = $no_comments_webpage;
I tested the code elsewhere and it seemed to work, but not with the plugin. can you prove some sample output of $webpage['@id'] or provide some pointers? :)
Article” type not stripping out things like
Reference: https://wordpress.org/support/topic/how-to-remove-comments-from-json-data/
The text was updated successfully, but these errors were encountered: