1. Documentation /
  2. Disable Payment Methods By Countries

Disable Payment Methods By Countries

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 top

To install and activate the extension, perform the following steps:

  1. Download the ZIP file from your WooCommerce.com dashboard
  2. Go to Plugins > Add New > Upload and select the ZIP file you just downloaded
  3. Click Install Now and then Activate the extension.

More information at: Install and Activate Plugins/Extensions.

Configuration

↑ Back to top

Once 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:

Configuration page of Disable Payment Methods by Countries plugin for WooCommerce

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 top

1. 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:

WooCommerce Not Installed/Active Error Message

✅ 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.

Payment Methods Not Enabled For WooCommerce Error Message

✅ To resolve this issue, go to WooCommerce Settings > Payments tab, and enable the required payment methods.

Configuring the extension

↑ Back to top

When 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.

Input fields on the plugin configuration page.

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 NameWooCommerce Code
Åland IslandsAX
AfghanistanAF
AlbaniaAL
AlgeriaDZ
AndorraAD
AngolaAO
AnguillaAI
AntarcticaAQ
Antigua and BarbudaAG
ArgentinaAR
ArmeniaAM
ArubaAW
AustraliaAU
AustriaAT
AzerbaijanAZ
BahamasBS
BahrainBH
BangladeshBD
BarbadosBB
BelarusBY
BelauPW
BelgiumBE
BelizeBZ
BeninBJ
BermudaBM
BhutanBT
BoliviaBO
Bonaire, Saint Eustatius and SabaBQ
Bosnia and HerzegovinaBA
BotswanaBW
Bouvet IslandBV
BrazilBR
British Indian Ocean TerritoryIO
British Virgin IslandsVG
BruneiBN
BulgariaBG
Burkina FasoBF
BurundiBI
CambodiaKH
CameroonCM
CanadaCA
Cape VerdeCV
Cayman IslandsKY
Central African RepublicCF
ChadTD
ChileCL
ChinaCN
Christmas IslandCX
Cocos (Keeling) IslandsCC
ColombiaCO
ComorosKM
Congo (Brazzaville)CG
Congo (Kinshasa)CD
Cook IslandsCK
Costa RicaCR
CroatiaHR
CubaCU
CuraÇaoCW
CyprusCY
Czech RepublicCZ
DenmarkDK
DjiboutiDJ
DominicaDM
Dominican RepublicDO
EcuadorEC
EgyptEG
El SalvadorSV
Equatorial GuineaGQ
EritreaER
EstoniaEE
EthiopiaET
Falkland IslandsFK
Faroe IslandsFO
FijiFJ
FinlandFI
FranceFR
French GuianaGF
French PolynesiaPF
French Southern TerritoriesTF
GabonGA
GambiaGM
GeorgiaGE
GermanyDE
GhanaGH
GibraltarGI
GreeceGR
GreenlandGL
GrenadaGD
GuadeloupeGP
GuatemalaGT
GuernseyGG
GuineaGN
Guinea-BissauGW
GuyanaGY
HaitiHT
Heard Island and McDonald IslandsHM
HondurasHN
Hong KongHK
HungaryHU
IcelandIS
IndiaIN
IndonesiaID
IranIR
IraqIQ
Isle of ManIM
IsraelIL
ItalyIT
Ivory CoastCI
JamaicaJM
JapanJP
JerseyJE
JordanJO
KazakhstanKZ
KenyaKE
KiribatiKI
KuwaitKW
KyrgyzstanKG
LaosLA
LatviaLV
LebanonLB
LesothoLS
LiberiaLR
LibyaLY
LiechtensteinLI
LithuaniaLT
LuxembourgLU
Macao S.A.R., ChinaMO
MacedoniaMK
MadagascarMG
MalawiMW
MalaysiaMY
MaldivesMV
MaliML
MaltaMT
Marshall IslandsMH
MartiniqueMQ
MauritaniaMR
MauritiusMU
MayotteYT
MexicoMX
MicronesiaFM
MoldovaMD
MonacoMC
MongoliaMN
MontenegroME
MontserratMS
MoroccoMA
MozambiqueMZ
MyanmarMM
NamibiaNA
NauruNR
NepalNP
NetherlandsNL
Netherlands AntillesAN
New CaledoniaNC
New ZealandNZ
NicaraguaNI
NigerNE
NigeriaNG
NiueNU
Norfolk IslandNF
North KoreaKP
NorwayNO
OmanOM
PakistanPK
Palestinian TerritoryPS
PanamaPA
Papua New GuineaPG
ParaguayPY
PeruPE
PhilippinesPH
PitcairnPN
PolandPL
PortugalPT
QatarQA
Republic of IrelandIE
ReunionRE
RomaniaRO
RussiaRU
RwandaRW
São Tomé and PríncipeST
Saint BarthélemyBL
Saint HelenaSH
Saint Kitts and NevisKN
Saint LuciaLC
Saint Martin (Dutch part)SX
Saint Martin (French part)MF
Saint Pierre and MiquelonPM
Saint Vincent and the GrenadinesVC
San MarinoSM
Saudi ArabiaSA
SenegalSN
SerbiaRS
SeychellesSC
Sierra LeoneSL
SingaporeSG
SlovakiaSK
SloveniaSI
Solomon IslandsSB
SomaliaSO
South AfricaZA
South Georgia/Sandwich IslandsGS
South KoreaKR
South SudanSS
SpainES
Sri LankaLK
SudanSD
SurinameSR
Svalbard and Jan MayenSJ
SwazilandSZ
SwedenSE
SwitzerlandCH
SyriaSY
TaiwanTW
TajikistanTJ
TanzaniaTZ
ThailandTH
Timor-LesteTL
TogoTG
TokelauTK
TongaTO
Trinidad and TobagoTT
TunisiaTN
TurkeyTR
TurkmenistanTM
Turks and Caicos IslandsTC
TuvaluTV
UgandaUG
UkraineUA
United Arab EmiratesAE
United Kingdom (UK)GB
United States (US)US
UruguayUY
UzbekistanUZ
VanuatuVU
VaticanVA
VenezuelaVE
VietnamVN
Wallis and FutunaWF
Western SaharaEH
Western SamoaWS
YemenYE
ZambiaZM
ZimbabweZW

Sample setup

↑ Back to top
How to use the WooCommerce Disable Payment Methods by Countries plugin

In 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 top

Have questions or in need of technical support? Feel free to reach out to us.