Product Structured data mixed up with related products

  • When I did the Google Structured Data (https://search.google.com/structured-data/testing-tool/) test on one of my product pages, it shows 1 product with multiple names, brands, and other product-related data. I found out that it also adds the product metadata from the “Related Products” section that comes on the product page under the product. This doesn’t happen in other SEO plugins that I’ve used in the past. Also, it doesn’t fetch the Brand.

Viewing 1 replies (of 1 total)
  • Hello,

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

    The Brand value is visible on the schema data of the product that you shared on the sensitive data section:
    Screen grab

    You can also remove the isRelatedTo entity from the schema by using the following code on your theme’s functions.php file:

    /**
     * Filter to modify schema daata.
     *
     * @param array $entity Snippet Data
     * @return array
     */
    add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
        if(isset($entity['isRelatedTo'])){
           unset($entity['isRelatedTo']);
           return $entity;
        }
       
        return $entity;
    });

    Looking forward to helping you. Thank you.

    ​​​​​​​

Viewing 1 replies (of 1 total)

You must be logged in to reply to this ticket.