Agent Wranglers

SEO-82Recommended

Mark up each product with its price and policies

If you sell products, give each product page Product structured data with an Offer that holds the price, currency and stock. Publish shipping and return policies once in Organization markup.

How to do it

Google shows price, stock, shipping and returns beside a result only from this data. A merchant listing needs name, image and an Offer with a price above zero and its currency. Use Offer for things you sell yourself, and AggregateOffer only on pages listing other sellers. Put the shipping and return policies under Organization, and override them on an offer only where a product differs. Generate the markup from the same record as the visible price, so the two never disagree, as Structured data that misleads warns. A product feed in Google Merchant Center is a second way to list products, and must carry the same prices. Validate as Validate rich results before every release says.

Examples

JavaScript example

export const productJsonLd = (product, url) => ({
  '@context': 'https://schema.org',
  '@type': 'Product',
  name: product.name,
  image: product.imageUrls,
  offers: {
    '@type': 'Offer',
    url,
    price: (product.priceMinor / 100).toFixed(2),
    priceCurrency: product.currency,
    availability: product.inStock ? 'https://schema.org/InStock' : 'https://schema.org/OutOfStock',
  },
});

Python example

def product_json_ld(product, url):
    return {
        "@context": "https://schema.org",
        "@type": "Product",
        "name": product.name,
        "image": product.image_urls,
        "offers": {
            "@type": "Offer",
            "url": url,
            "price": f"{product.price_minor / 100:.2f}",
            "priceCurrency": product.currency,
            "availability": "https://schema.org/InStock" if product.in_stock else "https://schema.org/OutOfStock",
        },
    }

How to check

A build test reads every product page. Its JSON-LD has Product with name, image and one Offer whose price and priceCurrency equal the visible price. The home page JSON-LD has an Organization with hasMerchantReturnPolicy and hasShippingService or shippingDetails.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/seo/search-result-appearance/product-structured-data">Agent Wranglers SEO playbook</a>. In code you write, add a comment next to it with the same link.