This guide will walk you through the seamless installation and configuration process of the Disable Payment Methods By Countries extension for WooCommerce.
With Disable Payment Methods by Countries, you can customize the payment options available on your store to cater to the needs of different countries, comply with regional regulations, or enhance your checkout process by enabling or disabling payment methods for specific countries, ensuring a seamless and localized shopping experience.
Requirements
↑ Back to top- WooCommerce version 5.0.0 or higher
- WordPress version 5.0 or higher
- PHP version 5.6 or higher
Installation and Setup
↑ Back to topTo install and activate the extension, perform the following steps:
- Download the ZIP file from your WooCommerce.com dashboard
- Go to Plugins > Add New > Upload and select the ZIP file you just downloaded
- Click Install Now and then Activate the extension.
More information at: Install and Activate Plugins/Extensions.
Configuration
↑ Back to topOnce successfully installed and activated, the extension configuration page will be accessible at WooCommerce Settings > Disable Payment Methods by Countries tab.
Here’s a sample screenshot displaying the configuration page of this extension:
Before we get into the details of each section of the configuration page, let’s discuss two scenarios where you might face errors.
Error scenarios
↑ Back to top1. WooCommerce not installed/active
❌ If you do not have the WooCommerce plugin active on your site, you’ll receive an error message asking you to install and activate the WooCommerce plugin first. Here’s how that’ll look:
✅ To resolve this issue, simply install and activate the WooCommerce plugin.
2. Payment methods not enabled for WooCommerce
❌ If there are currently no payment methods enabled for WooCommerce, the plugin configuration page will warn you about the same.
✅ To resolve this issue, go to WooCommerce Settings > Payments tab, and enable the required payment methods.
Configuring the extension
↑ Back to topWhen everything is set up correctly, the plugin displays all the active payment gateways on your site, along with two input fields – list of blocked countries, and a inverse selection check box – for each.
Here’s what to enter in those input fields:
- For each payment method, enter the country codes (separated by commas) in the “Blocked Countries” input box, to block the gateway in those countries. Leave empty to allow in all countries.
- Check the “Inverse Selection” checkbox to only allow the gateway in the selected countries (instead of block).
Country codes – What are they and how to obtain?
Country Codes are two-letter symbols used to represent each country. A reference chart is provided when you click on the Country Code Reference Chart button, under Quick Instructions, on the plugin configuration page.
Alternatively, you can also refer to the country codes chart given below.
Country Codes Chart
Country Name | WooCommerce Code |
Åland Islands | AX |
Afghanistan | AF |
Albania | AL |
Algeria | DZ |
Andorra | AD |
Angola | AO |
Anguilla | AI |
Antarctica | AQ |
Antigua and Barbuda | AG |
Argentina | AR |
Armenia | AM |
Aruba | AW |
Australia | AU |
Austria | AT |
Azerbaijan | AZ |
Bahamas | BS |
Bahrain | BH |
Bangladesh | BD |
Barbados | BB |
Belarus | BY |
Belau | PW |
Belgium | BE |
Belize | BZ |
Benin | BJ |
Bermuda | BM |
Bhutan | BT |
Bolivia | BO |
Bonaire, Saint Eustatius and Saba | BQ |
Bosnia and Herzegovina | BA |
Botswana | BW |
Bouvet Island | BV |
Brazil | BR |
British Indian Ocean Territory | IO |
British Virgin Islands | VG |
Brunei | BN |
Bulgaria | BG |
Burkina Faso | BF |
Burundi | BI |
Cambodia | KH |
Cameroon | CM |
Canada | CA |
Cape Verde | CV |
Cayman Islands | KY |
Central African Republic | CF |
Chad | TD |
Chile | CL |
China | CN |
Christmas Island | CX |
Cocos (Keeling) Islands | CC |
Colombia | CO |
Comoros | KM |
Congo (Brazzaville) | CG |
Congo (Kinshasa) | CD |
Cook Islands | CK |
Costa Rica | CR |
Croatia | HR |
Cuba | CU |
CuraÇao | CW |
Cyprus | CY |
Czech Republic | CZ |
Denmark | DK |
Djibouti | DJ |
Dominica | DM |
Dominican Republic | DO |
Ecuador | EC |
Egypt | EG |
El Salvador | SV |
Equatorial Guinea | GQ |
Eritrea | ER |
Estonia | EE |
Ethiopia | ET |
Falkland Islands | FK |
Faroe Islands | FO |
Fiji | FJ |
Finland | FI |
France | FR |
French Guiana | GF |
French Polynesia | PF |
French Southern Territories | TF |
Gabon | GA |
Gambia | GM |
Georgia | GE |
Germany | DE |
Ghana | GH |
Gibraltar | GI |
Greece | GR |
Greenland | GL |
Grenada | GD |
Guadeloupe | GP |
Guatemala | GT |
Guernsey | GG |
Guinea | GN |
Guinea-Bissau | GW |
Guyana | GY |
Haiti | HT |
Heard Island and McDonald Islands | HM |
Honduras | HN |
Hong Kong | HK |
Hungary | HU |
Iceland | IS |
India | IN |
Indonesia | ID |
Iran | IR |
Iraq | IQ |
Isle of Man | IM |
Israel | IL |
Italy | IT |
Ivory Coast | CI |
Jamaica | JM |
Japan | JP |
Jersey | JE |
Jordan | JO |
Kazakhstan | KZ |
Kenya | KE |
Kiribati | KI |
Kuwait | KW |
Kyrgyzstan | KG |
Laos | LA |
Latvia | LV |
Lebanon | LB |
Lesotho | LS |
Liberia | LR |
Libya | LY |
Liechtenstein | LI |
Lithuania | LT |
Luxembourg | LU |
Macao S.A.R., China | MO |
Macedonia | MK |
Madagascar | MG |
Malawi | MW |
Malaysia | MY |
Maldives | MV |
Mali | ML |
Malta | MT |
Marshall Islands | MH |
Martinique | MQ |
Mauritania | MR |
Mauritius | MU |
Mayotte | YT |
Mexico | MX |
Micronesia | FM |
Moldova | MD |
Monaco | MC |
Mongolia | MN |
Montenegro | ME |
Montserrat | MS |
Morocco | MA |
Mozambique | MZ |
Myanmar | MM |
Namibia | NA |
Nauru | NR |
Nepal | NP |
Netherlands | NL |
Netherlands Antilles | AN |
New Caledonia | NC |
New Zealand | NZ |
Nicaragua | NI |
Niger | NE |
Nigeria | NG |
Niue | NU |
Norfolk Island | NF |
North Korea | KP |
Norway | NO |
Oman | OM |
Pakistan | PK |
Palestinian Territory | PS |
Panama | PA |
Papua New Guinea | PG |
Paraguay | PY |
Peru | PE |
Philippines | PH |
Pitcairn | PN |
Poland | PL |
Portugal | PT |
Qatar | QA |
Republic of Ireland | IE |
Reunion | RE |
Romania | RO |
Russia | RU |
Rwanda | RW |
São Tomé and Príncipe | ST |
Saint Barthélemy | BL |
Saint Helena | SH |
Saint Kitts and Nevis | KN |
Saint Lucia | LC |
Saint Martin (Dutch part) | SX |
Saint Martin (French part) | MF |
Saint Pierre and Miquelon | PM |
Saint Vincent and the Grenadines | VC |
San Marino | SM |
Saudi Arabia | SA |
Senegal | SN |
Serbia | RS |
Seychelles | SC |
Sierra Leone | SL |
Singapore | SG |
Slovakia | SK |
Slovenia | SI |
Solomon Islands | SB |
Somalia | SO |
South Africa | ZA |
South Georgia/Sandwich Islands | GS |
South Korea | KR |
South Sudan | SS |
Spain | ES |
Sri Lanka | LK |
Sudan | SD |
Suriname | SR |
Svalbard and Jan Mayen | SJ |
Swaziland | SZ |
Sweden | SE |
Switzerland | CH |
Syria | SY |
Taiwan | TW |
Tajikistan | TJ |
Tanzania | TZ |
Thailand | TH |
Timor-Leste | TL |
Togo | TG |
Tokelau | TK |
Tonga | TO |
Trinidad and Tobago | TT |
Tunisia | TN |
Turkey | TR |
Turkmenistan | TM |
Turks and Caicos Islands | TC |
Tuvalu | TV |
Uganda | UG |
Ukraine | UA |
United Arab Emirates | AE |
United Kingdom (UK) | GB |
United States (US) | US |
Uruguay | UY |
Uzbekistan | UZ |
Vanuatu | VU |
Vatican | VA |
Venezuela | VE |
Vietnam | VN |
Wallis and Futuna | WF |
Western Sahara | EH |
Western Samoa | WS |
Yemen | YE |
Zambia | ZM |
Zimbabwe | ZW |
Sample setup
↑ Back to topIn this setup, the following rules apply:
- Direct bank transfer is enabled in all countries
- Pay at store is disabled in Canada and the United Kingdom (But available elsewhere).
- PayPal is disabled in India (But available elsewhere).
- Pay it later is enabled only in India. (This is achieved by checking the Inverse Selection option).
Support
↑ Back to topHave questions or in need of technical support? Feel free to reach out to us.