← Kaikki alustaoppaat

Lisää tuote-JSON-LD WooCommerceiin (devaajalle ja tekoälyagentillesi)

Tarkka, varmennettu tapa saada AI-haun JSON-LD WooCommerce-tuotesivulle — server-side ja monikielinen. Tee itse alla olevilla askeleilla, anna runbook tekoälyagentillesi, tai anna Store Operatorsin hoitaa se puolestasi.

Kaavio: näin lisäät tuote-JSON-LD:n WooCommerceiin AI-hakua varten — Lisää snippet-plugin (tai child-teema / WP-CLI); Autentikoi Application Passwordilla (vähimmän oikeuden käyttäjä); PHP-snippet tulostaa JSON-LD:n wp_headiin (vain tämä tuote); Haarauta kielen mukaan (WPML / Polylang); Verifioi lähdekoodi, sitten aktivoi
WooCommerce-JSON-LD-polku yhdellä silmäyksellä (havainnollistava kaavio).

Devaajalle

  1. JSON-LD:n on renderöidyttävä PALVELINPUOLELLA. WordPress/WooCommerce REST ei voi muokata teeman PHP:tä, joten käytä YHTÄ näistä: (a) snippet-plugin (Code Snippets tai WPCode) + PHP-snippet; (b) child-teeman functions.php SFTP/SSH:lla; tai (c) kevyt Store Operators -helper-plugin jos haluat sen ylläpidettynä koko katalogille.
  2. Lisää PHP-snippet joka koukkaa `wp_head` (tai `woocommerce_before_single_product`) ja tulostaa JSON-LD-`<script type="application/ld+json">`:n VAIN tälle tuotteelle: ehto `if (is_product() && get_the_ID() === <tuote-id>)`. Löydät <tuote-id>:n WooCommerce-administa (Products → tuote → post-ID URL:ssa).
  3. Monikielisyys (WPML / Polylang): haarauta nykyisen kielen mukaan (`get_locale()` / `ICL_LANGUAGE_CODE` / `pll_current_language()`) ja tulosta SEN kielen JSON-LD, jotta jokainen tuotteen kieliversio tarjoilee omansa (yksikielinen kauppa — ei haaraa).
  4. Vältä tuotekuvaus-kenttää `<script>`:lle: WordPress voi poistaa sen (`wp_kses`) käyttäjän oikeuksista riippuen (`unfiltered_html`), joten se on epäluotettava. Tulosta se `wp_head`-koukun kautta.

Monikielisyys = haarauta snippetissä nykyisen kielen mukaan (WPML/Polylang) TAI anna Store Operators -pluginin tarjoilla per-locale automaattisesti. Jokaisen kieliversion pitää tulostaa oman kielensä JSON-LD.

Katso tuote-URLin (kunkin kielen) lähdekoodi: `application/ld+json` läsnä ja validi.

Tarkka koodi

PHP-snippet (wp_head) — koodi JSON-LD:n lisäämiseen WooCommerceiin

Prompti tekoälyagentillesi — yhdistä WooCommerce & toteuta

Valmis kopioi–liitä-prompti omalle tekoälyagentillesi (Claude / ChatGPT). Se kertoo agentille miten se yhdistää WooCommerce-kauppaasi ja toteuttaa JSON-LD:n puolestasi — turvakurilla: varmuuskopio, esikatselu, verifiointi ja sinun hyväksyntäsi ennen julkaisua.

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:
{}

Mitä ihmiset kysyvät tekoälyltään

Mikä on prompti jolla yhdistän Clauden WooCommerce-kauppaan lisätäkseni tuote-JSON-LD:n?
Käytä tämän sivun runbookia — liitä se Claudeen. Se yhdistää WooCommerce-kauppaasi omilla tunnuksillasi ja lisää schema.org-JSON-LD:n, varmuuskopiolla, esikatselulla, verifioinnilla ja sinun hyväksynnälläsi ennen julkaisua.
Miten yhdistän ChatGPT:n WooCommerce-kauppaani lisätäkseni schema.org-JSON-LD:n?
Sama runbook toimii ChatGPT:llä (tai millä tahansa kyvykkäällä agentilla): se kirjautuu kauppaasi ja injektoi JSON-LD:n server-side, turvallisesti, ja pysähtyy hyväksyntääsi ennen julkaisua.
Voiko tekoälyagentti lisätä tuote-JSON-LD:n WooCommerceiin AI-hakua varten (ChatGPT, Perplexity, Google AI)?
Kyllä — server-side (pelkkää client-side-JavaScriptiä AI-crawlerit eivät luotettavasti näe). Tee se tämän sivun agentti-runbookilla, anna devaajalle, tai anna Store Operatorsin hoitaa se.

Lähteet

Näy ja tule suositelluksi tekoälyssä

Store Operators tekee kaupastasi AI-näkyvän ja agenttivalmiin — ilmaisesta auditista puolestasi rakennettuun datalayeriin ja agenttiseen kauppaan.