[Support request] Apply change to Schema Markup

Home Forums Support [Support request] Apply change to Schema Markup

Home Forums Support Apply change to Schema Markup

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2456403
    THIAGO

    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?

    #2456498
    Leo
    Staff
    Customer Support

    Hi there,

    I’m not sure unfortunately. The theme wouldn’t cause an issue like this.

    I can’t see how the code would be related to the caching though – perhaps you can comment on the post you found and see if the author can comment?

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.