Skip to content

Instantly share code, notes, and snippets.

@Auke1810
Last active February 2, 2023 16: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 Auke1810/372eeebf45d463c69da7d361a7b4dd39 to your computer and use it in GitHub Desktop.
Save Auke1810/372eeebf45d463c69da7d361a7b4dd39 to your computer and use it in GitHub Desktop.
Removes specific products from the feed generation process
// woocommerce product feed manager (www.marketingrobot.com)
// Removes specific products ID's from the feed generation process
function wppfm_exclude_product_ids_from_feed( $products_queue, $feed_id ) {
$products_to_exclude = array(
'20872',
'20875',
'20876',
'20879',
'20883',
'20895',
'20910',
);
return array_diff( $products_queue, $products_to_exclude );
}
add_filter( 'wppfm_products_in_feed_queue', 'wppfm_exclude_product_ids_from_feed', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment