Display the user’s country flag

Display the user's country flag, or any other country-related content from a CSV file.

Your Country Flag

Conditions/features in use: The Geolocation Condition & The CSV Extension

Display any country-related content using a CSV file

The country’s flag on this page is displayed using our CSV extension. The extension is built to create and manage thousands of different versions with ease, and with minimal effect on the loading speed.

The CSV file in this example consists of a list of all 249 countries, their names, and their flags. The file is available for you to download and use on your site.

How to display the user’s country flag on your site

If you’d like to display the visitor’s country flag, you can easily do so using our dynamic content from CSV extension. We already created a CSV file with all the countries’ flags, so all you need to do is import it to your site and display the flag using a shortcode anywhere on your site.

Import the countries’ flags CSV on your site

  1. Install the If-So CSV extension (if you haven’t already).
  2. Download the CSV country flag file (right-click here and choose “save link as…”).
  3. On your WordPress dashboard, go to If-So > Bulks.
  4. Name your Bulk (the name is for your reference only; you can name it “Country flags”, for example).
  5. Under “Condition Type”, select “Geolocation”.
  6. Under “Geolocation Type”, select “Country”.
  7. CSV separator – leave it as-is (“Comma”).
  8. Upload the file.
  9. Click “Create Bulk”.
Country flags

Displaying the flag on your page

  1. The Bulk you created in the previous step should now appear on the If-So > Bulks page. Find it and click “View”.
  2. Copy the shortcode of the columns with the flags.
  3. Paste the shortcode anywhere on your website.
  • Was this Helpful ?
  • YesNo



Engagement, User Experience



Realated templates and examples