← Documentation

WooCommerce

Install the WordPress plugin — zero config required. OCP auto-discovers your products, categories, and store settings.

Installation

1

Install the plugin

Upload the plugin via the WordPress admin panel or install from the plugin directory:

# Option A — WordPress plugin directory (recommended)
Plugins → Add New → Search "Open Commerce Protocol" → Install → Activate

# Option B — Manual upload
Download ocp-woocommerce.zip → Plugins → Add New → Upload Plugin
2

Verify the manifest

After activation the plugin auto-generates your manifest. Visit:

https://yourstore.com/.well-known/ocp.json

You should see a valid JSON manifest with your store name, currency, and product count.

3

Validate with the CLI

npx @opencommerceprotocol/cli validate https://yourstore.com

✓ /.well-known/ocp.json — valid
✓ /ocp.md — found
✓ /ocp/products.jsonl — 248 products, all valid
Score: 95/100

What the plugin generates

/.well-known/ocp.jsonManifest with store info, capabilities, and currency
/ocp.mdNatural language store description built from your WooCommerce settings
/ocp/products.jsonlFull product feed — paginated, rebuilt on publish
/ocp/products.jsonl?page=2Pagination support for large catalogs

Plugin settings

Navigate to WooCommerce → OCP Settings to configure:

Agent notes template
Handlebars template used to build agent_notes from product fields
Excluded categories
Categories to omit from the product feed
Cache TTL
How long the JSONL feed is cached (default: 1 hour)
Rate limit
Requests per minute allowed per IP for /ocp/* endpoints

Manual setup (without plugin)

If you prefer not to use the plugin, add this to your theme's functions.php:

functions.php
add_action('init', function () {
  // Serve /.well-known/ocp.json
  add_rewrite_rule('^.well-known/ocp.json$', 'index.php?ocp_manifest=1', 'top');
  add_filter('query_vars', fn($v) => array_merge($v, ['ocp_manifest']));
});

add_action('template_redirect', function () {
  if (!get_query_var('ocp_manifest')) return;
  header('Content-Type: application/json');
  echo json_encode([
    'version'  => '1.0',
    'merchant' => ['name' => get_bloginfo('name'), 'url' => home_url(), 'currency' => get_woocommerce_currency()],
    'capabilities' => ['catalog' => true, 'search' => true],
  ]);
  exit;
});