Skip to content

Instantly share code, notes, and snippets.

@glueckpress
Created January 9, 2014 15:29
Show Gist options
  • Select an option

  • Save glueckpress/8335883 to your computer and use it in GitHub Desktop.

Select an option

Save glueckpress/8335883 to your computer and use it in GitHub Desktop.
Snippet to clear customer IP address when order is sent. #woocommerce #wordpress
<?php
/**
* Snippet for deleting the customer IP address from WooCommerce orders.
* Important for Trusted Shops® certificates in Germany.
*/
add_action( 'woocommerce_checkout_update_order_meta', 'mp1401091554', 1 );
function mp1401091554( $order_id ) {
update_post_meta(
$order_id,
'_customer_ip_address',
0
);
}
@alexandervlpl
Copy link

This still works, thanks! 👍 I have a feeling this mp1401091554 key can change in any future version of WooCommerce/WordPress though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment