Magento Code: UK and Ireland counties for region drop-down in addresses

Posted in Magento on 14 April 2016

This post has been archived

The content of this post has not been updated since 2016, and may be out of date. Extra care should be taken with any code provided.

Full list of counties for the United Kingdom and Republic of Ireland. Run this SQL against your Magento database to replace the existing region text box in Magento with a drop down containing the values related to either the UK or Ireland.

Northern Irish counties will appear under United Kingdom and depending on website you may want to modify county names before importing.

-- Data for table `directory_country_region`

INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES
(1000, 'GB', 'AB', 'Aberdeenshire'),
(1001, 'GB', 'AN', 'Anglesey'),
(1002, 'GB', 'AG', 'Angus'),
(1003, 'GB', 'AR', 'Argyll'),
(1004, 'GB', 'AY', 'Ayrshire'),
(1005, 'GB', 'BN', 'Banffshire'),
(1006, 'GB', 'BD', 'Bedfordshire'),
(1007, 'GB', 'BI', 'Berwickshire'),
(1008, 'GB', 'BR', 'Breconshire'),
(1009, 'GB', 'BK', 'Buckinghamshire'),
(1010, 'GB', 'BU', 'Bute'),
(1011, 'GB', 'CN', 'Caernarvonshire'),
(1012, 'GB', 'CT', 'Caithness'),
(1013, 'GB', 'CM', 'Cambridgeshire'),
(1014, 'GB', 'CG', 'Cardiganshire'),
(1015, 'GB', 'CR', 'Carmarthenshire'),
(1016, 'GB', 'CH', 'Cheshire'),
(1017, 'GB', 'CL', 'Clackmannanshire'),
(1018, 'GB', 'CN', 'Cornwall and Isles of Scilly'),
(1019, 'GB', 'ANT', 'County Antrim'),
(1020, 'GB', 'ARM', 'County Armagh'),
(1021, 'GB', 'DOW', 'County Down'),
(1022, 'GB', 'FER', 'County Fermanagh'),
(1023, 'GB', 'DER', 'County Londonderry'),
(1024, 'GB', 'TYR', 'County Tyrone'),
(1025, 'GB', 'CU', 'Cumbria'),
(1026, 'GB', 'DI', 'Denbighshire'),
(1027, 'GB', 'DB', 'Derbyshire'),
(1028, 'GB', 'DV', 'Devon'),
(1029, 'GB', 'DO', 'Dorset'),
(1030, 'GB', 'DA', 'Dumbartonshire'),
(1031, 'GB', 'DU', 'Dumfriesshire'),
(1032, 'GB', 'DR', 'Durham'),
(1033, 'GB', 'EL', 'East Lothian'),
(1034, 'GB', 'ES', 'East Sussex'),
(1035, 'GB', 'EX', 'Essex'),
(1036, 'GB', 'FI', 'Fife'),
(1037, 'GB', 'FL', 'Flintshire'),
(1038, 'GB', 'GM', 'Glamorgan'),
(1039, 'GB', 'GL', 'Gloucestershire'),
(1040, 'GB', 'GR', 'Greater London'),
(1041, 'GB', 'GM', 'Greater Manchester'),
(1042, 'GB', 'HM', 'Hampshire'),
(1043, 'GB', 'HT', 'Hertfordshire'),
(1044, 'GB', 'IV', 'Inverness'),
(1045, 'GB', 'KN', 'Kent'),
(1046, 'GB', 'KE', 'Kincardineshire'),
(1047, 'GB', 'KP', 'Kinross-shire'),
(1048, 'GB', 'KC', 'Kirkcudbrightshire'),
(1049, 'GB', 'LA', 'Lanarkshire'),
(1050, 'GB', 'LC', 'Lancashire'),
(1051, 'GB', 'LE', 'Leicestershire'),
(1052, 'GB', 'LN', 'Lincolnshire'),
(1053, 'GB', 'LD', 'London'),
(1054, 'GB', 'ME', 'Merionethshire'),
(1055, 'GB', 'MR', 'Merseyside'),
(1056, 'GB', 'MO', 'Midlothian'),
(1057, 'GB', 'MO', 'Monmouthshire'),
(1058, 'GB', 'MG', 'Montgomeryshire'),
(1059, 'GB', 'MY', 'Moray'),
(1060, 'GB', 'NN', 'Nairnshire'),
(1061, 'GB', 'NR', 'Norfolk'),
(1062, 'GB', 'NH', 'Northamptonshire'),
(1063, 'GB', 'NU', 'Northumberland'),
(1064, 'GB', 'NY', 'North Yorkshire'),
(1065, 'GB', 'NO', 'Nottinghamshire'),
(1066, 'GB', 'OR', 'Orkney'),
(1067, 'GB', 'OX', 'Oxfordshire'),
(1068, 'GB', 'PB', 'Peebleshire'),
(1069, 'GB', 'PM', 'Pembrokeshire'),
(1070, 'GB', 'PT', 'Perthshire'),
(1071, 'GB', 'RD', 'Radnorshire'),
(1072, 'GB', 'RN', 'Renfrewshire'),
(1073, 'GB', 'RS', 'Ross & Cromarty'),
(1074, 'GB', 'RX', 'Roxburghshire'),
(1075, 'GB', 'SL', 'Selkirkshire'),
(1076, 'GB', 'SE', 'Shetland'),
(1077, 'GB', 'SH', 'Shropshire'),
(1078, 'GB', 'SO', 'Somerset'),
(1079, 'GB', 'SY', 'South Yorkshire'),
(1080, 'GB', 'ST', 'Staffordshire'),
(1081, 'GB', 'SN', 'Stirlingshire'),
(1082, 'GB', 'SU', 'Suffolk'),
(1083, 'GB', 'SU', 'Surrey'),
(1084, 'GB', 'SR', 'Sutherland'),
(1085, 'GB', 'TW', 'Tyne and Wear'),
(1086, 'GB', 'WR', 'Warwickshire'),
(1087, 'GB', 'WE', 'West Lothian'),
(1088, 'GB', 'WM', 'West Midlands'),
(1089, 'GB', 'WS', 'West Sussex'),
(1090, 'GB', 'WY', 'West Yorkshire'),
(1091, 'GB', 'WG', 'Wigtownshire'),
(1092, 'GB', 'WL', 'Wiltshire'),
(1093, 'GB', 'WO', 'Worcestershire'),
(1094, 'IE', 'CAR', 'Carlow'),
(1095, 'IE', 'CAV', 'Cavan'),
(1096, 'IE', 'CLA', 'Clare'),
(1097, 'IE', 'COR', 'Cork'),
(1098, 'IE', 'DON', 'Donegal'),
(1099, 'IE', 'DUB', 'Dublin'),
(1100, 'IE', 'GAL', 'Galway'),
(1101, 'IE', 'KER', 'Kerry'),
(1102, 'IE', 'KID', 'Kildare'),
(1103, 'IE', 'KIK', 'Kilkenny'),
(1104, 'IE', 'LET', 'Leitrim'),
(1105, 'IE', 'LEX', 'Leix'),
(1106, 'IE', 'LIM', 'Limerick'),
(1107, 'IE', 'LOG', 'Longford'),
(1108, 'IE', 'LOU', 'Louth'),
(1109, 'IE', 'MAY', 'Mayo'),
(1110, 'IE', 'MEA', 'Meath'),
(1111, 'IE', 'MOG', 'Monaghan'),
(1112, 'IE', 'OFF', 'Offaly'),
(1113, 'IE', 'ROS', 'Roscommon'),
(1114, 'IE', 'SLI', 'Sligo'),
(1115, 'IE', 'TIP', 'Tipperary'),
(1116, 'IE', 'WAT', 'Waterford'),
(1117, 'IE', 'WEM', 'Westmeath'),
(1118, 'IE', 'WEX', 'Wexford'),
(1119, 'IE', 'WIC', 'Wicklow');

-- Data for `directory_country_region_name`

INSERT INTO `directory_country_region_name` (`locale`, `region_id`, `name`) VALUES
('en_US', 1000, 'Aberdeenshire'),
('en_US', 1001, 'Anglesey'),
('en_US', 1002, 'Angus'),
('en_US', 1003, 'Argyll'),
('en_US', 1004, 'Ayrshire'),
('en_US', 1005, 'Banffshire'),
('en_US', 1006, 'Bedfordshire'),
('en_US', 1007, 'Berwickshire'),
('en_US', 1008, 'Breconshire'),
('en_US', 1009, 'Buckinghamshire'),
('en_US', 1010, 'Bute'),
('en_US', 1011, 'Caernarvonshire'),
('en_US', 1012, 'Caithness'),
('en_US', 1013, 'Cambridgeshire'),
('en_US', 1014, 'Cardiganshire'),
('en_US', 1015, 'Carmarthenshire'),
('en_US', 1016, 'Cheshire'),
('en_US', 1017, 'Clackmannanshire'),
('en_US', 1018, 'Cornwall and Isles of Scilly'),
('en_US', 1019, 'County Antrim'),
('en_US', 1020, 'County Armagh'),
('en_US', 1021, 'County Down'),
('en_US', 1022, 'County Fermanagh'),
('en_US', 1023, 'County Londonderry'),
('en_US', 1024, 'County Tyrone'),
('en_US', 1025, 'Cumbria'),
('en_US', 1026, 'Denbighshire'),
('en_US', 1027, 'Derbyshire'),
('en_US', 1028, 'Devon'),
('en_US', 1029, 'Dorset'),
('en_US', 1030, 'Dumbartonshire'),
('en_US', 1031, 'Dumfriesshire'),
('en_US', 1032, 'Durham'),
('en_US', 1033, 'East Lothian'),
('en_US', 1034, 'East Sussex'),
('en_US', 1035, 'Essex'),
('en_US', 1036, 'Fife'),
('en_US', 1037, 'Flintshire'),
('en_US', 1038, 'Glamorgan'),
('en_US', 1039, 'Gloucestershire'),
('en_US', 1040, 'Greater London'),
('en_US', 1041, 'Greater Manchester'),
('en_US', 1042, 'Hampshire'),
('en_US', 1043, 'Hertfordshire'),
('en_US', 1044, 'Inverness'),
('en_US', 1045, 'Kent'),
('en_US', 1046, 'Kincardineshire'),
('en_US', 1047, 'Kinross-shire'),
('en_US', 1048, 'Kirkcudbrightshire'),
('en_US', 1049, 'Lanarkshire'),
('en_US', 1050, 'Lancashire'),
('en_US', 1051, 'Leicestershire'),
('en_US', 1052, 'Lincolnshire'),
('en_US', 1053, 'London'),
('en_US', 1054, 'Merionethshire'),
('en_US', 1055, 'Merseyside'),
('en_US', 1056, 'Midlothian'),
('en_US', 1057, 'Monmouthshire'),
('en_US', 1058, 'Montgomeryshire'),
('en_US', 1059, 'Moray'),
('en_US', 1060, 'Nairnshire'),
('en_US', 1061, 'Norfolk'),
('en_US', 1062, 'Northamptonshire'),
('en_US', 1063, 'Northumberland'),
('en_US', 1064, 'North Yorkshire'),
('en_US', 1065, 'Nottinghamshire'),
('en_US', 1066, 'Orkney'),
('en_US', 1067, 'Oxfordshire'),
('en_US', 1068, 'Peebleshire'),
('en_US', 1069, 'Pembrokeshire'),
('en_US', 1070, 'Perthshire'),
('en_US', 1071, 'Radnorshire'),
('en_US', 1072, 'Renfrewshire'),
('en_US', 1073, 'Ross & Cromarty'),
('en_US', 1074, 'Roxburghshire'),
('en_US', 1075, 'Selkirkshire'),
('en_US', 1076, 'Shetland'),
('en_US', 1077, 'Shropshire'),
('en_US', 1078, 'Somerset'),
('en_US', 1079, 'South Yorkshire'),
('en_US', 1080, 'Staffordshire'),
('en_US', 1081, 'Stirlingshire'),
('en_US', 1082, 'Suffolk'),
('en_US', 1083, 'Surrey'),
('en_US', 1084, 'Sutherland'),
('en_US', 1085, 'Tyne and Wear'),
('en_US', 1086, 'Warwickshire'),
('en_US', 1087, 'West Lothian'),
('en_US', 1088, 'West Midlands'),
('en_US', 1089, 'West Sussex'),
('en_US', 1090, 'West Yorkshire'),
('en_US', 1091, 'Wigtownshire'),
('en_US', 1092, 'Wiltshire'),
('en_US', 1093, 'Worcestershire'),
('en_US', 1094, 'Carlow'),
('en_US', 1095, 'Cavan'),
('en_US', 1096, 'Clare'),
('en_US', 1097, 'Cork'),
('en_US', 1098, 'Donegal'),
('en_US', 1099, 'Dublin'),
('en_US', 1100, 'Galway'),
('en_US', 1101, 'Kerry'),
('en_US', 1102, 'Kildare'),
('en_US', 1103, 'Kilkenny'),
('en_US', 1104, 'Leitrim'),
('en_US', 1105, 'Leix'),
('en_US', 1106, 'Limerick'),
('en_US', 1107, 'Longford'),
('en_US', 1108, 'Louth'),
('en_US', 1109, 'Mayo'),
('en_US', 1110, 'Meath'),
('en_US', 1111, 'Monaghan'),
('en_US', 1112, 'Offaly'),
('en_US', 1113, 'Roscommon'),
('en_US', 1114, 'Sligo'),
('en_US', 1115, 'Tipperary'),
('en_US', 1116, 'Waterford'),
('en_US', 1117, 'Westmeath'),
('en_US', 1118, 'Wexford'),
('en_US', 1119, 'Wicklow');

Related Magento Posts

January 2024

Using Magento to get small businesses online

For small businesses aiming to establish a formidable online presence and drive sales, Magento emerges as a powerful e-commerce platform offering a suite of features...

Continue reading

October 2023

Magento database structure

The database structure of Magento is designed to store and manage various aspects of an e-commerce website, including products, orders, customers, and more. Understanding the...

Continue reading

August 2023

Accessibility in ecommerce websites

In the digital age, where online shopping has become an integral part of our lives, ecommerce websites hold the key to business success. Amidst the...

Continue reading

More Magento Posts