Rich text for product
-
I get error messages in the Google rich text tool when I use it on our products. It says:-
Missing field ‘aggregateRating’ (optional)
Missing field ‘Review’ (optional)
Missing field ‘Brand’ (optional)
No global identifier provided eg gtin, iSBN (optional)I thought I could fix this discrepancy by modifying the sample HTML code below but I don’t know where/ how to insert it in the product page.
I am using Woo with the Avada theme.
Any assistance would be much appreciated<html>
<head>
<title>Example product</title>
<script type=”application/ld+json”>
{
“@context”: “https://schema.org/”,
“@type”: “Product”,
“name”: “Fenn Mark4 trap + Mesh Tunnel”,
“image”: [
“https://www.trapbarn.com/wp-content/uploads/2021/10/Tunneltrap.jpg”
],
“description”: “Great trapping combination for rats and squirrels.”,
“sku”: “1MT”,
“mpn”: “7999939”,
“brand”: {
“@type”: “Brand”,
“name”: “Fenn”
},
“review”: {
“@type”: “Review”,
“reviewRating”: {
“@type”: “Rating”,
“ratingValue”: “5”,
“bestRating”: “5”
},
“author”: {
“@type”: “Person”,
“name”: “Ben Beardmore”
}
},
“aggregateRating”: {
“@type”: “AggregateRating”,
“ratingValue”: “4.9”,
“reviewCount”: “11455”
},
“offers”: {
“@type”: “Offer”,
“url”: “https://example.com/product”,
“priceCurrency”: “GBP”,
“price”: “27.75”,
“priceValidUntil”: “2021-11-25”,
“itemCondition”: “https://schema.org/NewCondition”,
“availability”: “https://schema.org/InStock”}
}
</script>
</head>
<body>
</body>
</html>`
`The page I need help with: [log in to see the link]
-
Hi there,
This is almost always due to a SEO plugin being installed on your site. Can you please copy and paste the system report for this site? You can find it under WP Admin > WooCommerce > Status > Get system report > Copy for support.
Here we go.
### WordPress Environment ###
WordPress address (URL): https://www.trapbarn.com
Site address (URL): https://www.trapbarn.com
WC Version: 6.0.0
REST API Version: ✔ 6.0.0
WC Blocks Version: ✔ 6.3.3
Action Scheduler Version: ✔ 3.3.0
WC Admin Version: ✔ 2.9.4
Log Directory Writable: ✔
WP Version: 5.8.2
WP Multisite: –
WP Memory Limit: 950 MB
WP Debug Mode: –
WP Cron: ✔
Language: en_GB
External object cache: –### Server Environment ###
Server Info: Apache
PHP Version: 7.4.27
PHP Post Max Size: 950 MB
PHP Time Limit: 300
PHP Max Input Vars: 2500
cURL Version: 7.79.1
OpenSSL/1.1.1g-fipsSUHOSIN Installed: –
MySQL Version: 5.5.5-10.2.33-MariaDB-log
Max Upload Size: 950 MB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔### Database ###
WC Database Version: 6.0.0
WC Database Prefix: wp_
Total Database Size: 52.62MB
Database Data Size: 36.34MB
Database Index Size: 16.28MB
wp_woocommerce_sessions: Data: 0.05MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_woocommerce_order_items: Data: 0.20MB + Index: 0.09MB + Engine InnoDB
wp_woocommerce_order_itemmeta: Data: 1.52MB + Index: 3.03MB + Engine InnoDB
wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
cerber_acl: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
cerber_blocks: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
cerber_countries: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
cerber_lab: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
cerber_lab_ip: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
cerber_lab_net: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
cerber_log: Data: 0.06MB + Index: 0.05MB + Engine InnoDB
cerber_qmem: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
cerber_traffic: Data: 0.09MB + Index: 0.02MB + Engine InnoDB
wp_actionscheduler_actions: Data: 0.52MB + Index: 0.55MB + Engine InnoDB
wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_actionscheduler_logs: Data: 0.23MB + Index: 0.22MB + Engine InnoDB
wp_ac_abandoned_cart_history_lite: Data: 0.05MB + Index: 0.00MB + Engine InnoDB
wp_ac_email_templates_lite: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_ac_guest_abandoned_cart_history_lite: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_ac_sent_history_lite: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_blc_filters: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_blc_instances: Data: 0.09MB + Index: 0.05MB + Engine InnoDB
wp_blc_links: Data: 0.38MB + Index: 0.06MB + Engine InnoDB
wp_blc_synch: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_cerber_files: Data: 7.56MB + Index: 0.00MB + Engine InnoDB
wp_cerber_sets: Data: 0.13MB + Index: 0.00MB + Engine InnoDB
wp_cerber_uss: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_commentmeta: Data: 0.06MB + Index: 0.03MB + Engine InnoDB
wp_comments: Data: 1.52MB + Index: 0.89MB + Engine InnoDB
wp_db7_forms: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_fusion_forms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_fusion_form_entries: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_fusion_form_fields: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_fusion_form_submissions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_gglcptch_allowlist: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_ms_snippets: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_odb_logs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_options: Data: 8.39MB + Index: 0.19MB + Engine InnoDB
wp_postmeta: Data: 6.52MB + Index: 8.03MB + Engine InnoDB
wp_posts: Data: 5.31MB + Index: 0.41MB + Engine InnoDB
wp_redirection_404: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_redirection_groups: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_redirection_items: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
wp_redirection_logs: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_snippets: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_termmeta: Data: 0.09MB + Index: 0.09MB + Engine InnoDB
wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_tm_taskmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_tm_tasks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_usermeta: Data: 1.13MB + Index: 0.06MB + Engine InnoDB
wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_wc_admin_notes: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wc_customer_lookup: Data: 0.16MB + Index: 0.13MB + Engine InnoDB
wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_order_product_lookup: Data: 0.20MB + Index: 0.27MB + Engine InnoDB
wp_wc_order_stats: Data: 0.17MB + Index: 0.22MB + Engine InnoDB
wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
wp_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wplnst_urls_status: Data: 0.08MB + Index: 0.23MB + Engine InnoDB
wp_wt_iew_action_history: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wt_iew_cron: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wt_iew_ftp: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wt_iew_mapping_template: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_yoast_indexable: Data: 0.30MB + Index: 0.22MB + Engine InnoDB
wp_yoast_indexable_hierarchy: Data: 0.05MB + Index: 0.05MB + Engine InnoDB
wp_yoast_migrations: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_yoast_primary_term: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_yoast_seo_links: Data: 0.13MB + Index: 0.09MB + Engine InnoDB
wp_yoast_seo_meta: Data: 0.09MB + Index: 0.00MB + Engine InnoDB### Post Type Counts ###
attachment: 194
avada_faq: 17
custom_css: 2
flamingo_contact: 34
flamingo_inbound: 16
fusion_element: 1
nav_menu_item: 42
oembed_cache: 12
page: 57
popup: 6
popup_theme: 7
post: 5
product: 18
product_variation: 42
revision: 146
shop_coupon: 1
shop_order: 1268
shop_order_refund: 14
wpcf7_contact_form: 2
wpcr3_review: 28### Security ###
Secure connection (HTTPS): ✔
Hide errors from visitors: ✔### Active Plugins (16) ###
Autoptimize: by Frank Goossens (futtta) – 2.9.4
Broken Link Checker: by WPMU DEV – 1.11.16
Contact Form 7: by Takayuki Miyoshi – 5.5.3
Avada Builder: by ThemeFusion – 3.6
Avada Core: by ThemeFusion – 5.6
Head, Footer and Post Injections: by Stefano Lissa – 3.2.2
My Custom Functions: by Space X-Chimp – 4.51
Redirection: by John Godley – 5.1.3
Optimize Database after Deleting Revisions: by CAGE Web Design | Rolf van Gelder
Eindhoven
The Netherlands – 5.0.110W3 Total Cache: by BoldGrid – 2.2.1
WooCommerce PayPal Checkout Gateway: by WooCommerce – 2.1.3
WooCommerce: by Automattic – 6.0.0
Yoast SEO: by Team Yoast – 17.8
Asset CleanUp Pro: Page Speed Booster: by Gabe Livan – 1.2.0.3
Asset CleanUp: Page Speed Booster: by Gabe Livan – 1.3.8.4
ReCaptcha v2 for Contact Form 7: by IQComputing – 1.3.6### Inactive Plugins (8) ###
Abandoned Cart Lite for WooCommerce: by Tyche Softwares – 5.11.1
Autoclear Autoptimize Cache: by Theme Surgeons – 2.1.1
Health Check & Troubleshooting: by The WordPress.org community – 1.4.5
Meks Quick Plugin Disabler: by Meks – 1.0
Product CSV Import Export (BASIC): by WebToffee – 2.1.3
WP Cerber Security, Anti-spam & Malware Scan: by Cerber Tech Inc. – 8.9.5
Yoast Duplicate Post: by Enrico Battocchi & Team Yoast – 4.3
Yoast Test Helper: by Team Yoast – 1.15### Dropin Plugins (1) ###
advanced-cache.php: advanced-cache.php
### Must Use Plugins (3) ###
Asset CleanUp Pro: Plugin Filtering: by Gabriel Livan – 1.0
Health Check Troubleshooting Mode: by – 1.7.2
StackCache: by Stack CP –### Settings ###
API Enabled: ✔
Force SSL: –
Currency: GBP (£)
Currency Position: left
Thousand Separator: ,
Decimal Separator: .
Number of Decimals: 2
Taxonomies: Product Types: external (external)
grouped (grouped)
simple (simple)
variable (variable)Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
exclude-from-search (exclude-from-search)
featured (featured)
outofstock (outofstock)
rated-1 (rated-1)
rated-2 (rated-2)
rated-3 (rated-3)
rated-4 (rated-4)
rated-5 (rated-5)Connected to WooCommerce.com: –
### WC Pages ###
Shop base: #6 – /shop-fenn-at-trap-barn/
Basket: #7 – /basket/
Checkout: #8 – /checkout/
My account: #9 – /my-account/
Terms and conditions: ❌ Page not set### Theme ###
Name: Avada Child1
Version: 6.2.3.1589448490
Author URL: http://themeforest.net/user/ThemeFusion
Child Theme: ✔
Parent Theme Name: Avada
Parent Theme Version: 7.6
Parent Theme Author URL: https://themeforest.net/user/ThemeFusion
WooCommerce Support: ✔### Templates ###
Overrides: Avada/woocommerce/cart/cart.php
Avada/woocommerce/checkout/form-pay.php
Avada/woocommerce/checkout/review-order.php
Avada/woocommerce/checkout/thankyou.php
Avada/woocommerce/loop/loop-start.php
Avada/woocommerce/single-product/add-to-cart/variable.php
Avada/woocommerce/single-product/short-description.php
Avada/woocommerce/single-product/tabs/additional-information.php
Avada/woocommerce/single-product/tabs/description.php### Action Scheduler ###
Complete: 1,352
Oldest: 2021-11-27 13:45:38 +0000
Newest: 2021-12-28 13:44:19 +0000Pending: 2
Oldest: 2021-12-28 13:59:19 +0000
Newest: 2021-12-28 19:12:14 +0000### Status report information ###
Generated at: 2021-12-28 13:44:33 +00:00
From what you say, I guess the product info is created by Yoast and written to the footer.
And the bits about Review, Aggregaterating etc are what’s has been left out by Yoast.
Hence it comes back to the question of how I can supplement what’s there by sample code I mentioned above. Where and how do I implant it in Woocommerce?@ mother.of.code.a11n
Just to progress matters , it might be best if someone can provide a bit of code to enable us to add a single brand name to each and all of our products. This would be better than using a plugin.
Hi @cullachie,
Thanks for sharing your system status.
I guess the product info is created by Yoast
That’s right and here’s an article on the Yoast SEO website on how to fix missing Schema properties for products:
https://yoast.com/help/how-to-fix-missing-schema-properties-for-products/
Hope this helps.
Hi there,
We haven’t heard from you in a while, so I’m going to mark this as resolved. Feel free to start a new thread if you have any more questions.
Use this as a workaround solution in your theme functions php:
function priyan_sh_woocommerce_structured_data_product( $markup, $product ) { if (empty($markup['mpn'])) $markup['mpn'] = $markup['sku']; if (empty($markup['brand'])) $markup['brand'] = array( '@type' => 'Brand', 'name' => 'YourBrandName' ); if (empty($markup['brand'])) $markup['brand'] = 'unknown'; if (empty($markup['aggregateRating'])) $markup['aggregateRating'] = array( '@type' => 'AggregateRating', 'ratingValue' => 5, 'reviewCount' => 1, ); if (empty($markup['review'])) $markup['review'] = array( '@type'=> 'Review', 'reviewRating'=> [ '@type'=> 'Rating', 'ratingValue'=> '5', 'bestRating'=> '5' ], 'author'=> [ '@type'=> 'Person', 'name'=> '' ] ); return $markup; }; add_filter( 'woocommerce_structured_data_product', 'priyan_sh_woocommerce_structured_data_product', 10, 2 );Worked on my site. I just changed the brand to my site name. And removed the brand value:
$product->get_name();Not getting any google issues about missing fields anymore.
Reference:
https://priyan.sh/woocommerce-missing-fields-structured-data/Note: This is not my site. And not my code. Just fyi 🙂
It’s a workaround. Otherwise you can always purchase the paid plugin:
https://woocommerce.com/products/google-product-feed/?aff=10486&cid=1131038I haven’t tried this plugin.
Many thanks. I will give it a try.
The topic ‘Rich text for product’ is closed to new replies.