Skip to main content
RelayWP

WooCommerce Integration

WooCommerce support requires RelayWP Pro.

What triggers a cache purge?

EventTags purged
Product stock changeproduct:{id}, product_cat:{slug} for all assigned categories
Product attribute updateproduct:{id}, all categories and tags
Product updated (any prop)product:{id}, all categories and tags
Order status changewc:cart, wc:checkout

Tag format for WooCommerce

RelayWP Pro uses these tag prefixes for WooCommerce content:

  • product:{id} — individual product
  • product_cat:{slug} — product category archive
  • product_tag:{slug} — product tag archive
  • wc:cart — cart page
  • wc: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 );