How to add List of Countries in Contact-Form-7

This tutorial is with Contact Form 7. If you have not installed the Plugin, i suggest you check this tutorial first » Installing Contact Form 7 – WordPress Plugin

Go to the Plugins page, search and add the plugin called Listo. It is from the same author who developed Contact Form 7.

Image 01.jpg

After activated the plugin you might not see any new menu in the Dashboard. Listo sits inside the Contact Form 7. Open your contact form Form tab and paste this code. Click Save.

<label> Your Name (required)
    [text* your-name] </label>

<label> Your Email (required)
    [email* your-email] </label>

<label> Subject
    [text your-subject] </label>

<label> Country
[select your-country data:countries] </label>

<label> Your Message
    [textarea your-message] </label>

[submit "Send"]

Go to your front-end and refresh the page, you should see a new dropdown for Countries. data:countries is ISO 3166 standard, with 200 country options to choose.

Image 02.jpg

Listo provides two subgroups – “un” and “olympic”.

  • un: is for Union Nations
  • olympic: only includes Participating nations at the 2012 London Summer Olympic Games

If you want to specify the subgroup, use the period and the name of the subgroup.

// To display un only
<label> Country
[select your-country data:countries.un] </label>

// To display olympic only
<label> Country
[select your-country data:countries.olympic] </label>

// To display olympic and un 
<label> Country
[select your-country data:countries.un.olympic] </label>

GoodHelpful!Very Helpful!Awesome!!   (2 votes, average: 4.00 out of 4)
Copyright © 2006 - 2019 beekeepersblog. All rights reserved