-
encountering a schema issue for your WooCommerce category page.
missing offer value in the schema
-
Hello,
We apologize for the issue you are facing with the schema on your WooCommerce category page. The missing offer value in the schema can occur because Google does not recommend adding Product Schema to category pages. This is because the Product Schema is meant to provide information about specific products, not categories of products.
To resolve this issue, you can remove the Product Schema from your category pages. Here’s a guide on how to do that:
- Navigate to Rank Math Settings: Go to your WordPress Dashboard.
- Access Schema Settings: Head to Rank Math SEO → Schema Markup.
- Remove Schema from Category Pages: Follow the instructions in this tutorial to remove the schema from your product category pages.
By doing this, you should be able to eliminate the missing offer value error in Google Search Console.
If you need further assistance, please reply to this ticket, and a human agent from the Rank Math Support team will assist you. Thank you for raising this concern!
Sources:
Remove All Schema from Product Category Pages » Rank MathHello,
Thank you for contacting Rank Math support.
Google recommends that
Product
schema be implemented only on single product pages. A page that lists multiple products, like your category, should not have a Product schema.This is the reason you’re seeing that error.
We hope this helps clarify the issue. Please let us know if you have any other questions or concerns.
so its better to use offercatalog schema for product collection page. can u give me tweak code to convert Carousel schema to offer catalog
Hello,
Sorry, but this type of customization falls outside the scope of our support. By default, our plugin adds
CollectionPage
schema which is acceptable for these types of pages.With the help of our PRO plugin, creating your own schema should be possible via Advanced Schema builder and then, you can check the schema format on the Schema website and modify it to suit your needs.
https://schema.org/OfferCatalog
Don’t hesitate to get in touch with us if you have any other questions.
this can be reolved if u just add additional property name ‘image’ to %itemlistloop%
Hello,
You can use the following filter to add the itemList Schema with details of each product to the category pages:
add_filter( 'rank_math/json_ld', function( $data, $jsonld ) { if(is_product_category()) { $products = get_posts( array( 'post_type' => 'product', 'numberposts' => -1, 'post_status' => 'publish', 'fields' => 'ids', 'tax_query' => array( array( 'taxonomy' => 'product_cat', 'field' => 'id', 'terms' => get_queried_object_id(), ) ), )); $data['itemList']['itemListElement'] = []; foreach($products as $key => $product) { $url = get_the_permalink($product); $schema[] = [ "@type"=> "ListItem", "position"=> $key, "item" => [ "@type" => "Product", "name" => get_the_title($product), "url"=> $url, "image" => get_the_post_thumbnail_url($product, 'full'), "offers" => [ "@type" => "offer", "priceCurrency" => "PKR", "price" => wc_get_product($product)->get_price() ], ] ]; $data['itemList']['@type'] = 'itemList'; $data['itemList']['itemListElement'] = $schema; } } return $data; }, 99, 2);
Here is how to add a filter to your site: https://rankmath.com/kb/wordpress-hooks-actions-filters/
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
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.
The ticket ‘Schema Issue in WooCommerce Category Page’ is closed to new replies.