Skip to content

Instantly share code, notes, and snippets.

@leewillis77
Last active September 23, 2019 08:58
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/96b01e82d9e668300d10d257838d20ec to your computer and use it in GitHub Desktop.
Save leewillis77/96b01e82d9e668300d10d257838d20ec to your computer and use it in GitHub Desktop.
Modify the g:ID element in WooCommerce Google Product Feed extension
<?php
function lw_woocommerce_gpf_feed_item_google( $feed_item, $product ) {
// Modify $feed_item->guid here.
// Note, you may also need to update $feed_item->item_group_id if you have variable products.
return $feed_item;
}
add_filter( 'woocommerce_gpf_feed_item_google', 'lw_woocommerce_gpf_feed_item_google', 11, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment