Store Operators/en/resources/woocommerce-json-ld#ohje
FIagent ready
Write JSON-LDWooCommerce

Product JSON-LD · WooCommerce

Add product JSON-LD to WooCommerce (for developers and for your AI agent)

The exact, verified way to put AI-search JSON-LD on a WooCommerce product page — server-side, and multilingual. Do it yourself with the steps below, hand the runbook to your AI agent, or let Store Operators do it for you.

developer guide · stepsLead support
01

JSON-LD must render SERVER-SIDE. The WordPress/WooCommerce REST API cannot edit theme PHP, so use ONE of: (a) a code-snippets plugin (Code Snippets or WPCode) with a PHP snippet; (b) your child theme's functions.php via SFTP/SSH; or (c) the lightweight Store Operators helper plugin if you want it auto-maintained across the whole catalogue.

02

Add a PHP snippet that hooks `wp_head` (or `woocommerce_before_single_product`) and echoes the JSON-LD `<script type="application/ld+json">` ONLY on this product: guard with `if (is_product() && get_the_ID() === <product-id>)`. Find <product-id> in the WooCommerce admin (Products → the product → the `post` ID in the URL).

03

Multilingual (WPML / Polylang): branch on the current language (`get_locale()` / `ICL_LANGUAGE_CODE` / `pll_current_language()`) and echo THAT language's JSON-LD, so each language version of the product serves its own (single-language store — no branch needed).

04

Avoid the product-description field for the `<script>`: WordPress may strip it via `wp_kses` depending on the editing user's capability (`unfiltered_html`), so it's unreliable. Emit it via `wp_head` instead.

verification and languages
Verify
View source on the product URL (each language): `application/ld+json` present and valid.
Multilingual
Multilingual = branch by current language in the snippet (WPML/Polylang) OR let the Store Operators plugin serve per-locale automatically. Each language version of the product must emit its own language's JSON-LD.
Diagram: how to add product JSON-LD to WooCommerce for AI search — Add a code-snippets plugin (or child theme / WP-CLI); Authenticate with an Application Password (least-privilege user); A PHP snippet echoes JSON-LD into wp_head (this product only); Branch by language (WPML / Polylang) for multilingual; Verify the source, then activate
The WooCommerce JSON-LD flow at a glance (illustrative diagram).
Agent prompt

Hand this to your own agent

This runbook adds product JSON-LD to one product at a time. It backs up first, works on an unpublished copy, verifies the result and publishes nothing without you.

runbook · woocommerce-json-ld.md · en1 784 merkkiä
You are helping me add AI-search JSON-LD to ONE product on my WooCommerce (WordPress) store, safely.

SAFETY (follow exactly, in order):
  1. Back up first: duplicate the current theme (or export it) BEFORE any write. No exceptions.
  2. Work on an UNPUBLISHED copy / preview — never edit the live theme directly.
  3. Use a least-privilege token: only the scopes the task needs.
  4. After each change, VERIFY (fetch the page, confirm the JSON-LD renders and is valid).
  5. Do NOT publish. Show the human the preview and the verification, and let the human approve the publish.
  6. Keep the rollback ready: if anything looks wrong, restore the backed-up theme.

ACCESS:
  - I will give you either WP-CLI/SSH access, or admin + a code-snippets plugin (Code Snippets/WPCode). Code injection needs one of these — the WooCommerce REST key alone CANNOT add theme code.

TASK:
  - Product URL: https://your-store.com/product/your-product. Store locales: your primary language.
  1. Back up first: export the active/child theme (or the current snippets).
  2. Add a PHP snippet (via the snippets plugin, or a child-theme mu-plugin via WP-CLI/SSH) that hooks `wp_head` and echoes the JSON-LD `<script type="application/ld+json">` ONLY on this product (`is_product() && get_the_ID() === <product-id>`). Avoid the product-description field (WordPress may strip scripts via wp_kses depending on user capability).
  3. If the store uses WPML/Polylang, branch on the current language and echo that language's JSON-LD (ask me for each language's JSON-LD — Outcite generates one per language).
  4. VERIFY: fetch the product URL (each language) and confirm `application/ld+json` is present and valid.
  5. STOP and show me the result. I activate/publish the snippet myself.

JSON-LD to inject:
{}
Writes only after your approval. The runbook forces the agent to back up before writing, work on an unpublished copy and verify the result. Publishing stays with you.

The runbook is in English on purpose — agent prompts work most reliably in English. You can still talk to the agent in your own language.

Already have your JSON-LD?

Outcite outputs a finished, per-language JSON-LD. Then the agent doesn't invent fields, it only installs the blocks correctly. Tell it how many language versions you have and the prompt adapts.

install · woocommerce-json-ld.md0 / 1 täytetty529 merkkiä
I already have a finished product JSON-LD from Outcite. Do NOT generate a new one and do NOT change its contents.

Platform: WooCommerce. Locales: 

I have one JSON-LD block.

Do this:
1. Install it so it renders server-side on the product page.
2. Do not alter any field values.
3. Verify the rendered page and show me the JSON-LD it outputs.

SAFETY: back up before any write, work on an unpublished copy, publish nothing without my approval, and tell me the rollback.

Paste the Outcite blocks below this line:
---
Installs, doesn't invent. The prompt forbids the agent from altering field values. With several locales it forces the platform's own translation mechanism instead of duplicated code.

Don't have your JSON-LD yet? Generate it with Outcite — it outputs a per-language block for every language version.

Frequently asked
01What is the prompt to connect Claude to WooCommerce to add product JSON-LD?

Use the runbook on this page — paste it into Claude. It connects to your WooCommerce store with your own credentials and adds the schema.org JSON-LD, with backup, preview, verification and your approval before publishing.

02How do I connect ChatGPT to my WooCommerce store to add schema.org JSON-LD?

The same runbook works for ChatGPT (or any capable AI agent): it authenticates to your store and injects the JSON-LD server-side, safely, and stops for your approval before publishing.

03Can an AI agent add product JSON-LD to WooCommerce for AI search (ChatGPT, Perplexity, Google AI)?

Yes — server-side (client-side-only JavaScript is not reliably seen by AI crawlers). Do it with the agent runbook here, hand it to a developer, or have Store Operators do it for you.

Sources
next · 30 seconds

What does your store look like to AI?

A free audit. No signup, works on every platform.

Book
● agent readyWooCommerceLead supportWooCommerce · Lead support