🛒 WooCommerce UCP Implementation

Make your WordPress + WooCommerce store AI-ready. Enable ChatGPT, Google AI Mode, and autonomous shopping agents to transact with your products.

🤖 AI Agent Ready🔌 Plugin Required🔧 Developer Options🔒 Secure

Why Add UCP to WooCommerce?

WooCommerce powers over 5 million online stores. Adding UCP (Universal Commerce Protocol) support makes your store discoverable by AI agents, enabling automatic product discovery and purchases through ChatGPT, Google AI Mode, and other AI assistants.

  • WordPress Flexibility: Full control over implementation via themes or plugins
  • REST API Ready: WooCommerce's REST API makes UCP integration natural
  • Schema.org Support: Many WooCommerce themes already include structured data
  • Plugin Ecosystem: Dedicated UCP plugins available
⚠️ Important: UCP Requires Working API Endpoints

UCP is not just a static JSON file — it requires functional REST API endpoints that AI agents can interact with. For WooCommerce, this means installing a plugin that implements UCP-compatible endpoints, or building custom API integration.

🔌 Recommended: UCP Connect Plugin

The easiest way to add UCP support is with the UCP Connect for WooCommerce plugin, which handles both the UCP profile and the required API endpoints. Search "UCP Connect" in Plugins → Add New.

Implementation Methods

Choose the method that best fits your needs:

MethodDifficultyBest For
UCP Proxy (Shopify)MediumFull UCP checkout with AI agents (Recommended)
UCP Connect PluginEasyStore owners, non-developers
Manual (functions.php)AdvancedDevelopers building custom UCP API endpoints
Custom PluginExpertEnterprise with full UCP API implementation
💡 Note for Store Owners

If you're not a developer, the plugin method is your best option. For full AI agent checkout capabilities, consider the UCP Proxy method.

Method 1: UCP Proxy by Shopify (Recommended)

UCP Proxy is an open-source proxy by Shopify that enables full UCP checkout capabilities for WooCommerce stores. Your store remains the system-of-truth; the proxy translates UCP requests to WooCommerce API calls.

Why UCP Proxy?
  • Full checkout flow support (not just discovery)
  • Google Pay integration via Stripe
  • 3D Secure handling for secure payments
  • Stateless architecture — scales to zero
  • Official Shopify open-source project
1Prerequisites
  • WooCommerce 6.9+ (for Store API support)
  • WooCommerce REST API keys (Read/Write)
  • Optional: Stripe plugin for Google Pay
  • Go 1.21+ (for running the proxy)
2Clone and Configure
# Clone the repository
git clone https://github.com/Shopify/ucp-proxy
cd ucp-proxy

# Create config file
cp config.example.json config.local.json

Edit config.local.json:

{
  "port": "8080",
  "adapter_type": "woocommerce",
  "merchant_id": "my-store",
  "merchant": {
    "store_url": "https://yourstore.com",
    "api_key": "ck_your_consumer_key",
    "api_secret": "cs_your_consumer_secret",
    "policy_links": {
      "privacy_policy": "https://yourstore.com/privacy",
      "terms_of_service": "https://yourstore.com/terms"
    }
  }
}
3Run the Proxy
# Start the proxy
CONFIG_FILE=config.local.json go run ./cmd/proxy

# Test discovery endpoint
curl http://localhost:8080/.well-known/ucp
4Deploy to Production

Deploy to GCP Cloud Run, AWS, or any container hosting:

# GCP Cloud Run example
gcloud run deploy ucp-proxy \
  --source . \
  --region us-central1 \
  --allow-unauthenticated
💡 Full Documentation

See the WooCommerce setup guide for payment configuration, 3DS handling, and production deployment.

Method 2: Using UCP Connect Plugin

The UCP Connect plugin handles everything: it creates the UCP profile, implements the required API endpoints, and enables AI agent checkout capabilities.

1Install UCP Connect Plugin
  1. Go to Plugins → Add New in your WordPress admin
  2. Search for "UCP Connect" or "UCP WooCommerce"
  3. Click Install Now, then Activate
💡 Manual Installation

If the plugin isn't in the repository yet, download from UCP Connect for WooCommerce and upload via Plugins → Add New → Upload Plugin.

2Configure the Plugin
  1. Go to WooCommerce → Settings → UCP
  2. Enter your store details (most will be auto-filled from WooCommerce)
  3. Review capabilities to expose (browse, search, checkout)
  4. Click Save Changes
3Verify Installation

Visit https://yourstore.com/.well-known/ucp to see your generated UCP profile.

Validate Your WooCommerce Store

After installing the plugin, validate your UCP implementation.

Run Validation →

Method 3: Manual Implementation (Developers Only)

For full control, implement UCP manually using WordPress functions. This method is for developers who need custom UCP implementations.

⚠️ Developer Notice

This method only creates a basic UCP discovery profile. For full AI agent checkout capabilities, you must also implement UCP-compatible REST API endpoints that handle product queries, cart operations, and checkout flows. The code below is a starting point, not a complete UCP implementation.

1Generate Your UCP Profile

Generate Your UCP Profile

Create a customized UCP profile for your WooCommerce store.

Open Generator →
2Add Rewrite Rule

Add this code to your theme's functions.php or a custom plugin:

// Add rewrite rule for /.well-known/ucp
function ucp_add_rewrite_rules() {
    add_rewrite_rule(
        '^\.well-known/ucp/?$',
        'index.php?ucp_profile=1',
        'top'
    );
}
add_action('init', 'ucp_add_rewrite_rules');

// Register query var
function ucp_query_vars($vars) {
    $vars[] = 'ucp_profile';
    return $vars;
}
add_filter('query_vars', 'ucp_query_vars');
3Create the Response Handler
// Handle UCP profile request
function ucp_template_redirect() {
    if (get_query_var('ucp_profile')) {
        header('Content-Type: application/json');
        header('Access-Control-Allow-Origin: *');
        
        $profile = [
            'profile_version' => '1.0',
            'merchant' => [
                'name' => get_bloginfo('name'),
                'url' => home_url(),
                'description' => get_bloginfo('description'),
                'contact' => [
                    'email' => get_option('woocommerce_email_from_address')
                ]
            ],
            'capabilities' => ['browse', 'search'],
            'policies' => [
                'returns_url' => get_privacy_policy_url(),
                'shipping_url' => home_url('/shipping-policy/'),
                'privacy_url' => get_privacy_policy_url()
            ],
            'service_bindings' => [
                [
                    'type' => 'REST',
                    'base_url' => home_url('/wp-json/wc/v3')
                ]
            ]
        ];
        
        echo json_encode($profile, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
        exit;
    }
}
add_action('template_redirect', 'ucp_template_redirect');
4Flush Rewrite Rules

After adding the code, flush rewrite rules:

  1. Go to Settings → Permalinks
  2. Click Save Changes (no changes needed, just save)
⚠️ Important

Always flush rewrite rules after adding new rewrite rules. Failing to do so will result in 404 errors.

Schema.org Markup

For maximum AI compatibility, ensure your products have proper Schema.org markup. Many WooCommerce themes include this by default.

Recommended Plugins

  • Yoast SEO: Includes WooCommerce schema support
  • Rank Math: Advanced schema options for products
  • Schema Pro: Dedicated schema plugin

Verify your schema with:

Validate Your Implementation

Validate Your WooCommerce Store

Check your UCP implementation and AI commerce readiness.

Run Validation →

Common Issues & Solutions

IssueSolution
404 on /.well-known/ucpFlush permalinks: Settings → Permalinks → Save
CORS errorsAdd Access-Control-Allow-Origin: * header
Wrong content typeEnsure Content-Type: application/json header
Caching issuesExclude /.well-known/ucp from caching plugins
💡 Caching Tip

If using WP Super Cache, W3 Total Cache, or similar, add /.well-known/ucp to the exclusion list.

🤖 Test with AI Agents

Run AI Agent Simulation

Test how AI shopping agents will interact with your WooCommerce store.

Open Simulator →

Resources