WooCommerce Integration
WooCommerce support requires RelayWP Pro.
What triggers a cache purge?
| Event | Tags purged |
|---|---|
| Product stock change | product:{id}, product_cat:{slug} for all assigned categories |
| Product attribute update | product:{id}, all categories and tags |
| Product updated (any prop) | product:{id}, all categories and tags |
| Order status change | wc:cart, wc:checkout |
Tag format for WooCommerce
RelayWP Pro uses these tag prefixes for WooCommerce content:
product:{id}— individual productproduct_cat:{slug}— product category archiveproduct_tag:{slug}— product tag archivewc:cart— cart pagewc:checkout— checkout page
Adding custom WooCommerce tags
add_filter( 'tagpurge_post_tags', function( array $tags, WP_Post $post ): array {
if ( $post->post_type === 'product' ) {
$tags[] = 'wc:shop'; // Always purge the Shop page too.
}
return $tags;
}, 10, 2 );