Hi, how can I effectively change my article Schema from:
itemtype="https://schema.org/BlogPosting"
to
itemtype="https://schema.org/BlogPosting" itemid="[[CURRENT_LINK]]#richSnippet"
I managed to do it with this function and the following code in my function.php:
add_filter('final_output', function($output) {
$link = get_permalink();
$itemid='itemtype="https://schema.org/BlogPosting" itemid="'.$link.'#richSnippet"';
return str_replace('itemtype="https://schema.org/BlogPosting"', $itemid, $output);
});
It did work, but ended up breaking my pages cache. Any idea of how can I do that in other way?