Programmatic structured data with Wix Velo: dynamic JSON-LD from database fields
Module 66: Wix Velo & Dev Mode: Advanced SEO for Developers | Lesson 675 of 687 | 36 min read
By Michael Andrews, Wix SEO Expert UK
Wix's standard SEO tools allow you to add structured data to static pages through the JSON-LD field in Advanced SEO settings. But for dynamic pages — product pages, service listings, blog posts, directory entries — the structured data needs to be dynamic too, populated with the actual data from each specific page. Wix Velo makes this possible, allowing you to programmatically generate and inject accurate, item-specific JSON-LD structured data for every dynamic page on your site.
Why Dynamic Structured Data Matters
A static JSON-LD block on a dynamic page will contain the same data for every item. This means if you have a product page template with static Product schema, every product's structured data will show the same name, price, and description — usually whatever was in the template at the time you created it. This is not only useless for Google Rich Results, it can actively mislead search engines and result in your structured data being ignored or flagged as inconsistent.
Injecting JSON-LD with Velo's wix-seo setStructuredData Function
// Dynamic page code for Wix product page
// This injects accurate Product schema for each item
import wixData from 'wix-data';
import { setStructuredData } from 'wix-seo';
$w.onReady(async function () {
const item = await wixData.getCurrentItem();
if (item) {
const productSchema = {
"@context": "https://schema.org",
"@type": "Product",
"name": item.title,
"description": item.description,
"image": item.mainImage,
"brand": {
"@type": "Brand",
"name": "Your Brand Name"
},
"offers": {
"@type": "Offer",
"price": item.price.toString(),
"priceCurrency": "GBP",
"availability": item.inStock
? "https://schema.org/InStock"
: "https://schema.org/OutOfStock",
"url": `https://yoursite.com/products/${item.slug}`
}
};
setStructuredData([productSchema]);
}
});
Schema Types to Prioritise for Dynamic Wix Pages
- Product schema for Wix Stores product pages — enables price, availability, and review rich results
- Article schema for Wix Blog posts — include author, datePublished, and dateModified
- Service schema for service listing dynamic pages — include serviceType, provider, and areaServed
- LocalBusiness schema for location pages — include address, geo coordinates, and opening hours
- Recipe schema for food and cooking sites using recipe database collections
- Event schema for Wix Events app dynamic event pages
Testing and Validating Dynamic Structured Data
Validation workflow for Velo-injected structured data
- Publish your Velo changes to the live site (structured data injection does not work in preview mode).
- Navigate to a live dynamic page on your Wix site.
- Open Google's Rich Results Test at search.google.com/test/rich-results.
- Enter the full URL of your dynamic page and run the test.
- Confirm that the correct schema type is detected and that all required properties are present.
- Test three to five different items from your collection to ensure the dynamic data is populating correctly for each.
- Check the Coverage > Rich Results section in Google Search Console after 48 hours to see if rich results are being detected site-wide.
This lesson on Programmatic structured data with Wix Velo: dynamic JSON-LD from database fields is part of Module 66: Wix Velo & Dev Mode: Advanced SEO for Developers in The Most Comprehensive Complete Wix SEO Course in the World (2026 Edition). Created by Michael Andrews, the UK's No.1 Wix SEO Expert with 14 years of hands-on experience, 750+ completed Wix SEO projects and 425+ verified five-star reviews.