Adding Schema Markup to a Food Ingredient Website in React
Most schema markup tutorials use a recipe blog or an online shoe store as the example. B2B sites get left out. Yet a food ingredient supplier has the same problem as any other business. Google and AI assistants need to u
Most schema markup tutorials use a recipe blog or an online shoe store as the example. B2B sites get left out. Yet a food ingredient supplier has the same problem as any other business. Google and AI assistants need to understand who the company is and what it sells and where it is based.
In this post I will walk through how we added JSON LD schema to a React site for a US food starch supplier. The site is Angel Starch USA and it lists organic and native and modified starches for food manufacturers. The same pattern works for any product catalog.
Why bother with schema on a B2B site
Search engines read your HTML and guess what it means. Schema removes the guessing. It tells them in plain structured data that this page is about a product with this name from this brand.
There is a second reason that matters more every month. AI answer engines pull from structured data when they describe a company. If a buyer asks an assistant for a tapioca starch supplier in Virginia the assistant has a much easier time when the address and products are marked up clearly.
Step 1. A tiny JsonLd component
We keep all schema in one small component. It takes a plain object and prints it inside a script tag.
export default function JsonLd({ data }) {
return (
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(data) }}
/>
);
}
The content is our own static data and not user input so using dangerouslySetInnerHTML here is safe. Never pass user submitted text into it.
Step 2. Organization schema on every page
This tells search engines who you are. We render it once in the main layout so it appears on every page.
export const organization = {
"@context": "https://schema.org",
"@type": "Organization",
name: "Angel Starch & Food Inc.",
url: "https://www.angelstarch.us/",
logo: "https://www.angelstarch.us/images/angel-starch-logo.png",
email: "[email protected]",
telephone: "+1-201-713-1465",
address: {
"@type": "PostalAddress",
streetAddress: "42846 Champney Ct",
addressLocality: "Broadlands",
addressRegion: "VA",
postalCode: "20148",
addressCountry: "US"
}
};
import JsonLd from "./JsonLd";
import { organization } from "./schema";
export default function Layout({ children }) {
return (
<>
{children}
</>
);
}
Keep the name and address exactly the same as on your Google Business Profile and your footer. Small differences confuse search engines.
Step 3. Product schema from your catalog data
We already had a products array that powers the catalog pages. Rather than writing schema by hand we build it from that same data. One source of truth means the schema never drifts away from what the page shows.
export function productSchema(p) {
return {
"@context": "https://schema.org",
"@type": "Product",
name: p.name,
description: p.description,
url: https://www.angelstarch.us${p.path},
category: p.category,
brand: { "@type": "Brand", name: "Angel Starch" }
};
}
export default function ProductPage({ product }) {
return (
{product.name}
{product.description}
);
}
One honest note. Google only shows product rich results when the schema includes offers or reviews or ratings. B2B ingredient suppliers usually quote prices per order so we left those out. Do not invent ratings to get stars. The plain Product schema still helps search engines and AI tools understand the catalog.
Step 4. FAQ schema for real questions
Our homepage answers common buyer questions such as what types of food starch the company supplies and how to request a sample. We mark those up with FAQPage.
export const faq = {
"@context": "https://schema.org",
"@type": "FAQPage",
mainEntity: [
{
"@type": "Question",
name: "Can I request a starch sample before placing a commercial order?",
acceptedAnswer: {
"@type": "Answer",
text: "Yes. Food manufacturers can request samples for lab and pilot testing through the sample request page."
}
}
]
};
Google now shows FAQ rich results for very few sites. We kept the markup anyway because it gives AI assistants clean question and answer pairs to read. Only mark up questions that actually appear on the page.
Step 5. Make sure crawlers see it
A React app that renders only in the browser can be slow to get indexed. Google does run JavaScript but other crawlers and many AI bots do not. Prerendering or server rendering puts the schema in the initial HTML so every crawler sees it. On Netlify a prerender plugin or a framework with static generation does the job.
Step 6. Test before you ship
Paste a live URL into the Google Rich Results Test and the Schema Markup Validator. Fix every error. Warnings about missing optional fields are fine as long as you understand them.
Wrapping up
Schema is not only for recipe blogs and big online stores. A small B2B food company can get a lot out of a few well built objects. Build the schema from the same data that renders the page and keep your business details identical everywhere. Search engines and AI assistants will understand you far better.
If you want to see the markup in action view the page source on angelstarch.us and look for the ld json script tags.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.