missing “brand” and “gtin” in Google Search Console

#96327
  • Resolved Christian Nothing
    Rank Math free

    Hello,

    all of a sudden the Google Search console gave me warnings for missing brand and gtin. I used code to modifiy it, i found it here in the forum. Any ideas how to fix this?

    Following code is used:

    /**
    * Filter to replace wc_brand with custom value.
    */
    add_filter( ‘rank_math/snippet/rich_snippet_product_entity’, function( $entity ) {
    if ( is_singular( ‘product’ ) ) {
    $product = wc_get_product();

    $brand = $product->get_attribute(‘pa_hersteller’);
    // Use this code to get 1st element from brand attribute if multiple brands are assigned to a Product.
    $brands = explode( ‘,’, $brand );
    if ( ! empty( $brands ) ) {
    $entity[‘brand’] = $brands[0];
    }
    }
    return $entity;
    });
    /**
    * Filter to modify schema data.
    * @brand for products
    * @param array $entity Snippet Data :
    * @return array
    */
    add_filter( ‘rank_math/snippet/rich_snippet_product_entity’, function( $entity ) {
    $entity[‘offers’][‘priceValidUntil’] = ‘2099-12-31’;
    $entity[‘gtin13’] = str_replace(‘-‘, ”,$entity[‘gtin’]);
    return $entity;
    });
    add_filter( “rank_math/snippet/rich_snippet_product_entity”, function( $entity ) {
    global $product;

    if ( is_a( $product, ‘WC_Product’ ) ) {
    $entity[‘gtin13’] = WC_trusted_shops()->trusted_shops->get_product_gtin( $product );
    }

    return $entity;
    });

Viewing 2 replies - 1 through 2 (of 2 total)
  • What the guy did in this post: https://support.rankmath.com/ticket/missing-brand-and-mpn/#post-97544

    Fixed it for me for the product i updated. So please fix this issue because i cant do this for all of my 2000 products.

    holidays are coming and my google rank is decreasing.

    Alberto
    Rank Math business

    Hello,

    Thank you for letting us know. We are working on it so we hope to release the fix really soon.

    Thank you for your patience.

    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 2 replies - 1 through 2 (of 2 total)

The ticket ‘missing “brand” and “gtin” in Google Search Console’ is closed to new replies.