select what to show in Product snippet

#8111
  • Resolved Weis Xan
    Rank Math free

    hi
    normally RankMath shows all attributes in structured data test
    how i can select to show some specified attributes?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Todd
    Rank Math free

    Hi Weis,

    Thanks for getting in touch with us.

    You can do so with the available filters here:

    https://rankmath.com/kb/filters-hooks-api-developer/#richsnippets

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

    tnx but i can’t find
    for example i want to show in product snippet just these attributes:
    diaplay-size
    ram
    cpi

    Hi there,

    Thanks for the follow up.

    Here is an example of how you can remove one of the properties on the product entity snippet:

    /**
     * Filter to modify product snippet
     *
     * @param array $entity Snippet Data
     * @return array
     */
    add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
    
        unset($entity['additionalProperty']);
        return $entity;
    });

    I hope this info helps. Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this ticket.