Skip to content
Faisal Mahmud TusherDigital marketing, SEO & analytics
with Faisal Tusher

AI in Marketing › AI Applications in Marketing

Checking AI-Generated Structured Data

How to use AI to draft structured data for a page template from its data fields, then check it against Google's guidelines, the visible page and the feed.
Tutorialintermediate9 min readUpdated

Why generated markup fails quietly

Structured data has to satisfy three readers at once. The vocabulary, schema.org, defines which types and properties exist. Google's documentation defines which of those types can produce rich results, which properties each requires or recommends, and the general guidelines every piece of markup must follow, above all that markup describes content visible on the page and does not misrepresent it. And the page itself, with the catalogue and feed behind it, defines what is true. Markup can be valid against the first and still fail the other two.

A model writing markup works from patterns in what it learned, as the guide to how language models generate text explains. The patterns include a great deal of old and copied markup from across the web. So the model proposes properties that exist in the vocabulary but that Google does not use for the type, types whose rich result has been retired, and, when the prompt gives it a single example page, values it fills in by itself: a rating because product markup usually has one, a brand because the type has a brand property. It also tends to write finished markup for the example it was shown, which a team then pastes into one page and forgets.

The structured data guide's rule for avoiding drift is to generate markup from the same data that renders the page. This routine applies that rule to generated work: the model drafts the mapping, people check it, and the template produces the markup.

FailureWhat it looks likeWhere the routine catches it
Undocumented propertyValid vocabulary that Google does not list for the typeChecking every property against Google's documentation
Retired or wrong typeA type whose rich result no longer shows, or a type the page does not qualify forChoosing the documented type first
Content not on the pageA rating, an offer or an answer the visitor cannot seeRemoving anything the page does not show
Invented or hard-coded valueA brand, price or rating count typed into the markupGenerating values from the template's own fields
Feed disagreementMarkup price or availability different from the Merchant Center feedComparing a sample with the feed
Markup missing after renderingA script the template adds that never reaches the rendered pageRendering a sample and validating it

Before you start

  • The page template you are marking up, and a list of its live pages by variety: on sale, out of stock, with and without reviews, with variants.
  • The template's data fields, the catalogue or content fields it displays, with their names and formats.
  • Google's documentation for the type, read on the day: the general structured data guidelines, the introduction to structured data and the type's own page. These are the reference for required and recommended properties and eligibility; this page does not copy them.
  • The Merchant Center feed (Product Feed) attribute list, if the store has one.
  • Search Console access (GSC) for the property, to read the enhancement reports.
  • An approved AI tool. The model needs field names, formats and invented sample values, not live customer or order data.
  • A developer or template owner who can change how the template outputs markup.

The steps

  1. Choose the page template and the documented type it qualifies for

    Start with the template, not with a type. Decide what the page is: a product a shopper can buy, a location of a business, an article. Then find the type Google documents for that kind of page and confirm the page qualifies; the structured data guide lists the types most sites should consider and the product structured data tutorial separates product snippets from merchant listings. For location pages, the LocalBusiness structured data tutorial is the reference. Write down the type and the page you read, with the date, before asking the model anything.

  2. List the visible content and the data fields the template displays

    Open a typical page and list everything a visitor can see that the type could describe: name, images, description, price, stock, reviews, address, opening hours. Beside each item, write the data field that renders it. Anything that has no field, such as a sentence written into the template, is a candidate for leaving out. Anything that appears only on some pages, such as reviews, gets a note saying when it shows. This list is what the markup is allowed to say.

  3. Ask the model for a mapping from fields to properties, not finished markup per page

    Give the model the type, the list of visible content and fields with invented sample values, and ask for a table: data field, proposed property, whether the property sits on the main type or a nested one, and the condition under which it is output. Ask it to mark every property it believes is required or recommended and to say where that belief comes from, and to flag any field it could not map. Ask for a sample of the output for one invented record only so you can read the shape. Do not accept finished markup for a real page; it will be copied and it will drift.

  4. Check every type and property against Google's documentation and schema.org

    Go through the mapping line by line with Google's page for the type open. For each property, confirm that Google documents it for the type, and whether as required or recommended; where Google is silent, check schema.org to see whether it exists at all. Properties that exist in schema.org but not in Google's documentation may be harmless, but they earn no rich result and they are often where the model filled a gap, so keep them only for a reason you can state. Treat the model's claims about what is required as unverified until the documentation confirms them, and check that nested types are nested where the documentation nests them.

  5. Remove anything the page does not show, ratings above all

    Set the mapping beside the visible content list and delete every property whose value the visitor cannot see on that page. Ratings and reviews come first: the product tutorial's rule is to add them only where real customer reviews of that product are shown, and a product with no reviews gets no rating markup at all. The guide to AI claims and consumer protection sets out why endorsements must be genuine, which applies to a rating a model added as much as to a written testimonial. Remove generated answers, offers and properties that describe content hidden from users; the structured data guide records that misleading markup can cost a site its rich results, and the spam policies guide covers how Google describes acting on deception more broadly.

  6. Generate the markup from the same data the page displays

    Hand the checked mapping to whoever owns the template, so the template writes the markup from the same fields that render the page. Values come from fields, never from text typed into the template: the price from the price field, availability from the stock field, the rating from the review system only when reviews show. Conditional properties follow the conditions in the mapping. This is the step that stops drift, because when the catalogue changes the page and its markup change together.

  7. Render a sample of pages and validate them

    Pick one page of each variety from the list gathered before you started and check the rendered page, not the template source; the SEO release checks guide treats structured data in the rendered HTML as part of every release, which matters wherever Rendering adds the markup with script. Run each through the validators the structured data guide names: one for syntax and real vocabulary, Google's test for rich result eligibility. Fix every error. Read every warning against the mapping and add a recommended property only if the template has a real field for it. Then compare each sample's markup with what the page shows, value by value.

  8. Compare prices and availability with the feed

    For product templates, set the sample's price, currency, availability and identifiers beside the Merchant Center feed for the same products. The product tutorial asks for the markup, the page and the feed to agree, because the feed and the markup are two routes for the same product data. A disagreement usually means one of them is fed from a different source or a different moment; fix the source rather than the symptom. Where there is no feed, compare the markup with the catalogue record the page renders from.

  9. Release it and watch the enhancement reports

    Release the template through the normal release process, then read the enhancement reports in Search Console for the type. The structured data guide describes them: valid items, items with warnings and items with errors, with the property at fault. Errors from a generated mapping usually appear as a required property that is empty on some pages or a value in the wrong format. If valid markup still produces no rich result, the rich results not showing guide works through why. Record the mapping, the documentation pages read, the samples tested and the person who approved it, so the next template starts from a checked example.

The NIST AI Risk Management Framework gives this routine its shape: know where the model's output goes, measure it against the documentation and the page, and keep a person accountable for what ships. The same pattern runs through the checking AI-written SQL tutorial, and the AI product descriptions guide covers the visible copy this markup describes. The applications hub lists the other task guides. Before the template releases its markup, the AI-written code review checklist is the short gate that runs these steps beside the checks for generated tags, formulas and queries.

A tea merchant checks a generated product template (illustrative)

Illustrative example — not a real result

Pruvenca Tea Merchants rebuilds generated product markup as a template

Pruvenca Tea Merchants, an invented online seller of loose-leaf tea with 240 product pages, asks an AI tool for product markup by pasting one product page. The model returns finished JSON-LD for that page. A marketer pastes it into the page's custom code field and asks for the same for the next 10 products.

The SEO lead stops the rollout and runs the routine. The check finds 3 problems:

FindingWhy it failsFix
An aggregate rating of 4.8 from 36 reviews on pages that show no reviewsRatings must reflect real, visible reviewsRating output only when the review widget shows reviews, from the review system's fields
A property Google does not document for the typeEarns nothing; added by the modelRemoved
A price of £12.50 typed into the markupDrifts at the next price change; the page now shows £11.00Price read from the catalogue's price field

The team writes a mapping of 9 catalogue fields to properties, the developer builds it into the product template, and the 11 hand-pasted blocks are removed. A rendered sample of 6 pages, covering a tea on sale, one out of stock, one with reviews and one without, passes validation, and all 6 match the feed on price and availability. After release, the product enhancement report shows 2 pages with an error for a missing image, traced to 2 products with no photo in the catalogue.

Common mistakes

  • Accepting finished markup for one page. It gets copied and drifts; ask for a field mapping the template can use.
  • Trusting the model's list of required properties. Google's documentation for the type is the reference; read it on the day.
  • Keeping a rating because the template looks bare without one. No visible reviews means no rating markup.
  • Typing values into markup. Prices, stock and counts belong to the catalogue fields the page already uses.
  • Validating the template source instead of the rendered page. What a search engine reads is the rendered output.
  • Stopping at the validator. Eligibility is not accuracy; compare values with the page and the feed.
  • Marking up content the page does not show. Hidden answers and offers misrepresent the page, whoever wrote them.
  • Not watching the reports after release. Errors from empty fields appear only once every page renders the markup.

Frequently asked questions

If the generated markup passes a validator, can it go live?

Not on that alone. A validator confirms the syntax and, for supported types, which required and recommended properties are present. It cannot tell whether the price matches the page, whether the reviews behind a rating are real and visible, or whether a value was typed in once and will drift. Those checks are made against the page, the catalogue and the feed, and they matter as much as the validator's verdict.

Will AI-written structured data improve our rankings?

The site's structured data guide notes that Google documents no general ranking benefit from markup, whoever writes it. Markup can make pages eligible for rich results and helps a search engine understand what a page describes. Generated markup earns those uses only if it is accurate, documented for the type and in agreement with the visible page.

Why ask for a field mapping instead of finished markup?

Because markup written for one page is copied, edited and left behind, and its values drift away from the page as prices, stock and reviews change. A mapping from the template's data fields to properties can be checked once and then used by the template to generate markup for every page from the same data the page displays, which is how the site's structured data guide says markup stays correct.

Terms used on this page

Frameworks

Also related

Sources

  1. General structured data guidelines — Google Search Central
  2. Introduction to structured data markup in Google Search — Google Search Central
  3. Product structured data — Google Search Central
  4. Schema.org — Schema.org
  5. Search Console Help — Google Search Console Help

Related