• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Logo

impressive pages: Webdesign und eCommerce

  • Home
  • Blog
  • Hosting
  • Contact
Start » Blog » Solution for Google Search Console – Message: „brand“ field is missing

Solution for Google Search Console – Message: “brand” field is missing

22. December 2021 Leave a Comment

Feld "brand" fehlt

If you run a shop with WooCommerce you have certainly already discovered the message opposite in Google Search Console under Improvements -> Products.

By default, the WooCommerce plugin for WordPress does not add the “Brand” scheme to WooCommerce product pages. That means there is a loophole in the WooCommerce schema.

Various support threads on WordPress.org and Github say that this can be solved by buying a WooCommerce plugin. With something as basic as this one can be very frustrating, and rightly so.

Ultimately, WooCommerce’s justification is that these are not essential parts of the schema – they only generate warnings in the Google Search Console, but not errors. So in theory, they’re not a big deal.

However, if you want to close this loophole, you have several options. There are “schema plugins” out there to help you patch this up – the Yoast SEO WooCommerce plugin fills the gaps for you – but it is a bit of an exaggeration to spend around 70 euros a year for this. Unless you have or need it for another important reason. Then these instructions will help.

Many people avoid code-based solutions because they have to be “maintained” and break regularly. So for an ecommerce website that makes you money, that’s not great!

Google Search Console fix code – brand field warning

With the Code Snippets plugin , small code snippets like the following can be integrated into the page. Professionals have a separate plug-in for such adjustments or use the functions.php of their theme.

/*
* Füge "Brand"-Schema in die Strukturierten Daten ein
*/
function custom_woocommerce_structured_data_product ($data) {
	global $product;
	$data['brand'] = ['@type' => 'Brand', 'name' => 'Meine Marke'];
	return $data;
}
add_filter( 'woocommerce_structured_data_product', 'custom_woocommerce_structured_data_product' );

If you are the manufacturer of your products or if you only sell goods from one brand, you can insert your brand here instead of ” My brand ” (quotation marks must remain).

Alternatively, the brand can also be extracted from the Brand property with $ product-> read out get_attribute (‘pa_brand’) .

The code snippet would then look like this:

/*
* Füge "Brand"-Schema in die Strukturierten Daten ein
*/
function custom_woocommerce_structured_data_product ($data) {
	global $product;
        $data['brand'] = ['@type' => 'Brand', 'name' => $product->get_attribute('pa_brand') ?? null];
	return $data;
}
add_filter( 'woocommerce_structured_data_product', 'custom_woocommerce_structured_data_product' );

I am using a manufacturer’s product property for a customer. Therefore I set the “Brand” field with the manufacturer with the command $ product-> get_attribute (‘pa_manufacturer’) .

To test the success, use the practical online tool from Google: Test structured data .

Filed Under: Google Search Console, SEO, WooCommerce

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Search

Recent Posts

  • WooCommerce: Show free shipping only
  • Remove wrapper DIVs (.wrap) in Genesis
  • Remove the number of products in the category list from the category name
  • Change the number of similar products in WooCommerce
  • Genesis Visual Hook Guide

Categories

  • development
  • Genesis framework
  • Google Search Console
  • mobile
  • SEO
  • Uncategorized
  • Web hosting
  • WooCommerce
  • WordPress

Archives

  • May 2022
  • January 2022
  • December 2021
  • imprint
  • Data protection

Footer

!pages
Heinrich Franz
Wilhelm-Martin-Str. 4
76356 Weingarten (Baden)
instagram
+49 160 85 40 725
info@impressive-pages.de

In my Blog I publish articles about WordPress, Genesis framework und SEO.

© 2022 impressive pages

  • Deutsch