Invalid object type for field ‘brand’ (optional)

#435812
  • Resolved Shravani k
    Rank Math free

    I have added the code you suggested as well,
    // Add Brand for Products.
    add_filter( ‘rank_math/snippet/rich_snippet_product_entity’, function( $entity ) {
    $entity[‘brand’] = ‘Deconstruct’;
    return $entity;
    });

    But still i am unable to clear this warning
    Attaching screenshots for your reference.Please help!

Viewing 1 replies (of 1 total)
  • Anas
    Rank Math business

    Hello,

    Thank you for contacting Rank Math, and sorry for any inconvenience caused.

    Please replace the filter with this one and see if that helps:

    /**
     * Filter to add custom Brand for WooCommerce Products.
     * 
     * @param array $entity Snippet Data
     * @return array
     */
    add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
        $entity['brand']['@type'] = 'Brand';    
        $entity['brand']['name'] = 'Rank Math';
        return $entity;
    });

    Hope this helps.

    Don’t hesitate to get in touch if you have any other questions.

    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 ‘Invalid object type for field ‘brand’ (optional)’ is closed to new replies.