Skip to content

Instantly share code, notes, and snippets.

@leewillis77
Last active February 7, 2023 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leewillis77/65fc4babd0f7a3776966e2324965bf6a to your computer and use it in GitHub Desktop.
Save leewillis77/65fc4babd0f7a3776966e2324965bf6a to your computer and use it in GitHub Desktop.
Exclude multiple categories from the Google Product Feed
<?php
function lw_gpf_exclude_product( $excluded, $product_id, $feed_format ) {
// return TRUE to exclude this product
// return FALSE to include this product
// return $excluded to keep the standard behaviour for this product.
return $excluded;
}
add_filter( 'woocommerce_gpf_exclude_product', 'lw_gpf_exclude_product', 11, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment