Question about a custom code

#425489
  • Resolved thinh nguyen
    Rank Math free

    Hi there,

    May I know the use and which case should use the below code:


    add_filter('rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
    global $post;
    $entity['@id'] = get_the_permalink( $post );
    return $entity;
    });

    Thanks

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math support, and sorry for any inconvenience that might have been caused due to that.

    The purpose of that filter is to modify a specific schema type which in your case, is the product schema. You are currently modifying the @id property.

    Here is a guide you can follow to add the filter into your website:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Question about a custom code’ is closed to new replies.