Skip to content

Instantly share code, notes, and snippets.

@pascalknecht
Created December 1, 2017 10:20
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pascalknecht/8d94babbea537ab16b5f98a460c43301 to your computer and use it in GitHub Desktop.
Save pascalknecht/8d94babbea537ab16b5f98a460c43301 to your computer and use it in GitHub Desktop.
WooCommerce ship only to EU Countries
UPDATE `wp_options` SET `option_value`='specific' WHERE option_name = 'woocommerce_ship_to_countries';
UPDATE `wp_options` SET `option_value`='a:28:{i:0;s:2:"AT";i:1;s:2:"BE";i:2;s:2:"HR";i:3;s:2:"BG";i:4;s:2:"CY";i:5;s:2:"CZ";i:6;s:2:"DK";i:7;s:2:"EE";i:8;s:2:"FI";i:9;s:2:"FR";i:10;s:2:"DE";i:11;s:2:"GR";i:12;s:2:"HU";i:13;s:2:"IE";i:14;s:2:"IT";i:15;s:2:"LV";i:16;s:2:"LT";i:17;s:2:"LU";i:18;s:2:"MT";i:19;s:2:"NL";i:20;s:2:"PL";i:21;s:2:"PT";i:22;s:2:"RO";i:23;s:2:"SK";i:24;s:2:"SI";i:25;s:2:"ES";i:26;s:2:"SE";i:27;s:2:"GB";}' WHERE option_name = 'woocommerce_specific_ship_to_countries';
@mjdigital
Copy link

Thanks for this - I noticed it did not include Jersey or the Isle of Man which are two islands off the coast of the UK and still (currently) in the EU - the below SQL includes these if anyone needs:

UPDATE wp_optionsSEToption_value='a:30:{i:0;s:2:"AT";i:1;s:2:"BE";i:2;s:2:"BG";i:3;s:2:"HR";i:4;s:2:"CY";i:5;s:2:"CZ";i:6;s:2:"DK";i:7;s:2:"EE";i:8;s:2:"FI";i:9;s:2:"FR";i:10;s:2:"DE";i:11;s:2:"GR";i:12;s:2:"HU";i:13;s:2:"IE";i:14;s:2:"IM";i:15;s:2:"IT";i:16;s:2:"JE";i:17;s:2:"LV";i:18;s:2:"LT";i:19;s:2:"LU";i:20;s:2:"MT";i:21;s:2:"NL";i:22;s:2:"PL";i:23;s:2:"PT";i:24;s:2:"RO";i:25;s:2:"SK";i:26;s:2:"SI";i:27;s:2:"ES";i:28;s:2:"SE";i:29;s:2:"GB";}' WHERE option_name = 'woocommerce_specific_ship_to_countries';

Thanks though - saved me loads of time :)

@pascalknecht
Copy link
Author

Hi @mjdigital. Nice to hear that this was useful for you 👍

@webdesignerz81
Copy link

hi, just wondering where you would insert this code?

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