WordPress & WooCommerce
Content sync
Once the WordPress plugin is connected to your workspace, content has to be pushed into Glozr through two modes: a manual bulk sync and an automatic delta sync that reacts to post and product changes.
Content sources
The plugin handles three entity types, each mapped to a Glozr source row:
- Posts & pages. Source kind
wordpress, document IDs in thewp:{post_id}form. - WooCommerce products. Source kind
woocommerce_products, document IDs in thewc:{product_id}form. - WooCommerce coupons. Embedded in the product source's
configJSON rather than living as a separate source.
Each agent-site pair gets one source per kind. Posts and products coexist on the same agent.
Bulk sync
From Settings → Glozr in WordPress, two buttons trigger manual syncs:
- Sync posts now. Walks every published post in batches of 50.
- Sync products now. Shown when WooCommerce is active. Covers simple, variable, grouped and external products.
You'll see a status line such as “Sync complete. (124 posts, 87 queued, 37 skipped)”. Skipped items have a matching content hash and don't need re-embedding.
Large-site resumption
For sites that would otherwise exceed PHP's max_execution_time, the syncer enforces a 20-second wall-clock guard. When the guard fires with pages remaining:
- A resume marker is stored as a WordPress transient.
- WP-Cron schedules continuation 30 seconds later.
- The UI surfaces: “large site detected — the rest is continuing in the background”.
Note. If WP-Cron is disabled or your traffic is too low to fire it, the sync will appear stuck. See Troubleshooting for the manual cron-kick recipe.
Delta sync (automatic)
Once the bulk sync has run, WordPress hooks keep Glozr in step:
- Posts/pages:
save_post,wp_trash_post,before_delete_post. - Products: WooCommerce-specific save and trash hooks.
Each hook fires a single delta call to the Glozr API with either an upsert or delete action.
Content normalization
Before pushing, the plugin normalizes content through:
- Page-builder detection (Elementor, Beaver Builder, Oxygen, Bricks, Divi). See Page builders.
- Gutenberg block expansion.
- The full WordPress content filter chain.
- Shortcode resolution.
- The
pitchbar_post_content_htmlfilter, which lets you intercept the final HTML or suppress the row entirely by returning an empty string.
Indexed fields
For each post: title, excerpt, taxonomy terms, body HTML, permalink, post type, modification timestamp, detected language.
For each product: name, SKU, primary image, short and long descriptions, pricing, stock status, categories, and a flattened representation of product attributes.
The content hash is SHA-256 over the concatenated title, content, excerpt and taxonomy terms with collapsed whitespace. Matching hashes skip embedding entirely.
Coupon syncing
After the product sync, the plugin scans WooCommerce coupons (filtering out expired and exhausted ones) and stores them in the product source's config['coupons'] array with code, label, discount and expiration. Active coupons become available to the agent for emission. See WooCommerce deep links for how coupons are applied at cart time.
Vertical auto-detection
The first successful product upsert against a generic site type automatically switches the agent's vertical to ecommerce. This unlocks product-card recommendations in the widget.
Delete semantics
Delete calls tear down the document row, its chunks, and the corresponding vectors in one transaction. Repeated deletes are silent no-ops — there's no error if the row is already gone.
Programmatic sync
For migrations and CLI workflows, three PHP entry points are available:
PostSyncer->runFullSync()— bulk-sync posts/pages.ProductSyncer->runFullSync()— bulk-sync WooCommerce products.CouponSyncer->run()— refresh the coupon block on the product source.