Skip to main content

Getting Started

Haus Storefront Product Sync synchronizes products, collections, facet values, and related metadata from your Vendure backend into WordPress.

With this plugin you can:

  • Sync products from Vendure into WordPress posts and meta
  • Map Vendure collections and facet values to WordPress taxonomies
  • Keep catalog data updated for Elementor dynamic tags and custom templates
  • Run full or incremental sync via WP-CLI (with cron-friendly locking)
Prerequisites
  • A running Vendure Shop API
  • WP-CLI on the WordPress host (required to run sync)
  • WordPress admin access
  • Recommended: Haus Storefront Elementor Widgets — supplies Vendure connection constants from Haus Storefront → Advanced

Install and Activate

  1. Install the plugin in wp-content/plugins/wp-products-sync (Composer package wearehaustech/wp-products-sync or deployment ZIP).
  2. Activate Haus Storefront Product Sync on the plugins screen.
  3. Confirm Sync Settings appears under Haus Storefront (or as a top-level menu when Haus Storefront is not installed).

Connect to Vendure

The sync engine reads PHP constants — there is no API URL field in the Product Sync admin UI.

Configure Haus Storefront → Advanced:

  • API URL — full Vendure Shop API URL (including /shop-api/)
  • Default Channel Token — channel token for storefront requests

The main plugin defines VENDURE_API_URL and VENDURE_TOKEN for Product Sync on plugins_loaded.

Standalone

Add to wp-config.php:

define('VENDURE_API_URL', 'https://your-vendure-host/shop-api/');
define('VENDURE_TOKEN', 'your-channel-token');

Configure Sync Settings

Open WordPress Admin → Haus Storefront → Sync Settings (or Sync Settings when standalone).

Taxonomy mappings (optional)

Map Vendure data to WordPress taxonomies:

Admin fieldWhenPurpose
Vendure sourcealwayscollection or facet
WordPress taxonomyalwaysTaxonomy slug in WordPress (for example product-brands)
Collection IDsource = collectionRoot collection ID in Vendure
Facet Codesource = facetFacet code in Vendure

Synchronization options

OptionPurpose
Flush permalinks after syncRegenerate rewrite rules when slugs change
Keep removed items (soft delete)Mark removed terms instead of deleting
Sync collection descriptionsCopy collection description text into WordPress
Enable custom field syncSync selected Vendure custom fields (configure selections below)

When custom field sync is enabled, choose product, collection, and facet fields in Custom Field Selection.

Click Save to persist settings to the wp_products_sync_settings option.

Run a Sync

First full sync

wp sync-products sync

Waits up to 600 seconds (default) if another sync holds the lock. Override with --wait=<seconds>.

Incremental sync (cron)

wp sync-products syncUpdated

Fetches only products with updatedAt newer than the previous incremental run. Does not remove products deleted in Vendure — use the nightly full sync for reconciliation.

*/5 * * * * cd /path/to/wp && wp sync-products syncUpdated
0 3 * * * cd /path/to/wp && wp sync-products sync --wait=600

Both commands share one lock — only one sync runs at a time.

Other WP-CLI commands

CommandAction
wp sync-products removeLockClear a stuck sync lock
wp sync-products deleteDestructive — delete all synced products
wp sync-custom-fields syncSync Vendure custom-field definitions
wp sync-custom-fields listList stored custom-field definitions

The admin UI includes a WP-CLI Commands reference dialog with the same commands.

Sync Health

Check status without admin access:

GET /wp-json/wp-products-sync/v1/product-sync-health

Returns ok, running, or locked. Use Unlock in the admin Status section if a lock is stuck.

Data Handling

Product Sync writes directly to WordPress tables.

Core tables

  • Products: wp_posts
  • Product metadata: wp_postmeta
  • Taxonomy terms: wp_terms + wp_term_taxonomy
  • Term metadata: wp_termmeta
  • Product-to-taxonomy relationships: wp_term_relationships

Product metadata keys

  • vendure_id — unique Vendure product ID used for matching updates
  • vendure_updated_at — last sync update timestamp
  • vendure_description — synced description
  • vendure_featured_asset_source — featured image URL/path
  • vendure_num_option_groups — option group count
  • vendure_slug_mismatch — flag when WordPress slug differs from backend
  • vendure_* — synced Vendure custom field values (prefixed keys)
  • exclude_from_sync — skip this product on sync runs when set

Term metadata keys

  • vendure_collection_id — Vendure collection ID (collection taxonomies)
  • vendure_term_id — Vendure facet value ID (facet taxonomies)
  • vendure_updated_at — last sync update timestamp
  • vendure_soft_deleted — soft-delete flag when enabled
  • vendure_term_image — synced term image
  • vendure_term_position — position/order from Vendure
  • vendure_slug_mismatch — slug mismatch flag
  • vendure_* — synced custom field values
Viewing synced fields

Product Sync does not include a field-management UI for synced meta. Use a meta box plugin or Elementor dynamic tags (group Haus Storefront) to surface values in the admin or templates.

Logs

Daily sync logs are written under:

wp-content/uploads/vendure-sync/YYYY-MM-DD.log

Next Steps