Missing Yoast SEO Product Schema fields

  • May 3, 2021
  • 0
Hire Vivek Asodariya

What is schema structure?

Although the schema is defined in the text database language, the term is used for a graphical representation of the database structure. In other words, a schema is the structure of a database that defines the objects in the database.

What is Product Schema?

The product schema is basically the structured data of your product that will be published along with your search result. This helps search engines to provide more information about your product to be published on the SERP for the best user experience. Product schemas are basically used to display your product information in a more structured way in the SERP.

The Benefits of Product Schema

Product schemas can display price, availability, review ratings and other product qualities on a specific search result, so this schema type can increase the pixel space of your SERP list.

The added value of various product qualities also works to increase organic click-through rate (CTR).

Why is product schema important?

The product schema allows search engines to publish more information about your products, and because search engines like as much product information as possible, it helps your web page rank higher. That’s why it’s good to keep those pieces of information to yourself.

Why is Product Schema So Important and What is Its Role in Your SEO Strategy?

You can think of a product schema as an SEO tool that enables you to include more important information about your products that you want to get in front of your audience and potential customers. The product schema allows search engines to publish more information about your products, and because search engines like as much product information as possible, it helps your web page rank higher. That’s why it’s good to keep those pieces of information to yourself. To get the most out of your product schema, you may want to brush up on your knowledge of certain things, such as getting reviews for your company.

If the Google search console is generating the below error then you can add the below code.

Missing field “review

Missing field “aggregateRating

Missing field “sku

Missing field “gtin8

Missing field “brand

Add below code in your (child) theme’s functions.php

<?php
add_filter( 'wpseo_schema_product', 'vivek_patel_yoast_seo_product_schema' );
function vivek_patel_yoast_seo_product_schema( $data ) {
    global $product;
	$product_id = $product->get_id();
	$product = new WC_Product($product_id);
	if(!isset($data['review']))
	{
		$review = array();
		$review['@type'] = 'Review';
		$review['reviewRating']['@type'] = 'Rating';
		$review['reviewRating']['ratingValue'] = '5';
		$review['reviewRating']['bestRating'] = '5';
		$review['author']['@type'] = 'Person';
		$review['author']['name'] = 'Villabagio';
		$data['review'] = $review;
	}
	if(!isset($data['aggregateRating']))
	{
		$aggregateRating = array();
		$aggregateRating['@type'] = 'AggregateRating';
		$aggregateRating['ratingValue'] = '5';
		$aggregateRating['reviewCount'] = '5';
		$data['aggregateRating'] = $aggregateRating;
	}
	if(!isset($data['sku']))
	{
		$data['sku'] = $product->get_id();
	}	
		
	$data['gtin8'] = $data['sku'];
	$data['brand'] = 'VIVEK';
	

    return $data;
}
?>

Leave a Reply

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