Title: Phone Country Flag for FormCraft
Author: Kanani Parth
Published: <strong>November 28, 2026</strong>
Last modified: November 28, 2026

---

Search plugins

![](https://ps.w.org/phone-country-flag-for-formcraft/assets/banner-772x250.png?
rev=3830843)

![](https://ps.w.org/phone-country-flag-for-formcraft/assets/icon.svg?rev=3830843)

# Phone Country Flag for FormCraft

 By [Kanani Parth](https://profiles.wordpress.org/kananiparth1326/)

[Download](https://downloads.wordpress.org/plugin/phone-country-flag-for-formcraft.1.0.0.zip)

[Live Preview](https://wordpress.org/plugins/phone-country-flag-for-formcraft/?preview=1)

 * [Details](https://wordpress.org/plugins/phone-country-flag-for-formcraft/#description)
 * [Reviews](https://wordpress.org/plugins/phone-country-flag-for-formcraft/#reviews)
 *  [Installation](https://wordpress.org/plugins/phone-country-flag-for-formcraft/#installation)
 * [Development](https://wordpress.org/plugins/phone-country-flag-for-formcraft/#developers)

 [Support](https://wordpress.org/support/plugin/phone-country-flag-for-formcraft/)

## Description

**Phone Country Flag for FormCraft** enhances FormCraft form fields by adding an
interactive international country flag dropdown, dial code selector, and visitor
country code auto-detection.

It turns standard text or number fields in FormCraft into smart, user-friendly international
phone inputs powered by the industry-standard `intl-tel-input` library.

### Key Features

 * **Direct Custom Field Class Support**: Simply assign your chosen CSS class (`
   phone-country-flag` or `fcpf-phone-flag`) to any field inside FormCraft’s field
   settings to instantly enable the country flag dropdown on that specific field.
 * **Automatic Visitor Country Detection**: Detects the visitor’s country using 
   browser-based GeoIP lookup (cached in the browser to reduce network requests).
 * **Smart Keyword Matching**: Automatically discovers phone fields across your 
   forms based on common keywords (e.g., `mobile`, `phone`, `whatsapp`, `contact`,`
   tel`).
 * **Real-Time Phone Validation**: Validates international phone formats on blur
   and input change, displaying friendly custom error messages when an invalid number
   is entered.
 * **Preferred & Restrictive Countries**: Pin key countries to the top of the dropdown
   list or restrict the selector to only accept specific countries.
 * **FormCraft Popup & AJAX Support**: Seamlessly works with AJAX-submitted forms,
   multi-step forms, and popup modals using DOM mutation observers.
 * **100% Bundled & GDPR Friendly**: All core CSS, JavaScript, and flag sprite assets
   are bundled locally in the plugin — no external CDN dependencies.
 * **Zero Bloat & High Performance**: Lightweight, asynchronous script execution
   with browser localStorage caching.

### How to use with FormCraft

 1. **Option A (Recommended) – Custom Field Class:**
 2.  * Edit your form in FormCraft.
     * Click on the phone/mobile field to open its **Field Options**.
     * Under **Extra Classes** (or **Custom CSS Class**), enter `phone-country-flag`(
       or your custom class defined in plugin settings).
     * Save the form. The field will now automatically display the country flag dropdown!
 3. **Option B – Automatic Detection:**
 4.  * Simply label your field with “Phone”, “Mobile”, “WhatsApp”, or “Contact Number”.
     * The plugin automatically identifies the field and attaches the flag dropdown.
 5. **Option C – CSS Selector:**
 6.  * For advanced forms, enter a specific CSS selector in **Settings > FormCraft 
       Phone Flag**.

### Privacy Policy / Third-Party Services

This plugin provides an optional feature to automatically detect a visitor’s country
code based on their IP address:

 1. **ipwhois.io / ipwho.is** (Primary GeoIP provider)
 2.  * Service URL: https://ipwhois.io/
     * Terms of Service: https://ipwhois.io/terms
     * Privacy Policy: https://ipwhois.io/privacy
     * Data transmitted: The visitor’s IP address is sent directly from the visitor’s
       browser to resolve their 2-letter country code.
 3. **ipapi.co** (Fallback GeoIP provider)
 4.  * Service URL: https://ipapi.co/
     * Terms of Service: https://ipapi.co/terms/
     * Privacy Policy: https://ipapi.co/privacy/
     * Data transmitted: The visitor’s IP address is sent directly from the visitor’s
       browser if the primary provider fails.

**Opt-out**: Site administrators can completely disable GeoIP auto-detection at 
any time by unchecking “Detect visitor’s country from IP address” in **Settings 
> FormCraft Phone Flag**. When disabled, no external requests are made and the default
fallback country is used instead.

## Screenshots

[⌊Plugin Settings Page: Configure custom field classes, keyword detection, fallback
country, preferred country list, and phone validation.⌉⌊Plugin Settings Page: Configure
custom field classes, keyword detection, fallback country, preferred country list,
and phone validation.⌉[

**Plugin Settings Page**: Configure custom field classes, keyword detection, fallback
country, preferred country list, and phone validation.

[⌊FormCraft Frontend Form Preview: Interactive country flag dropdown, dial code 
selector, and live phone validation in action.⌉⌊FormCraft Frontend Form Preview:
Interactive country flag dropdown, dial code selector, and live phone validation
in action.⌉[

**FormCraft Frontend Form Preview**: Interactive country flag dropdown, dial code
selector, and live phone validation in action.

## Installation

 1. Upload the `phone-country-flag-for-formcraft` folder to your `/wp-content/plugins/`
    directory, or install it directly via the WordPress Admin Plugins screen.
 2. Activate the plugin through the **Plugins** menu in WordPress.
 3. Navigate to **Settings > FormCraft Phone Flag** in your WordPress dashboard to 
    configure your default country, preferred countries, custom field class, and validation
    rules.
 4. Open your FormCraft form and add the custom CSS class `phone-country-flag` to any
    phone field, or let the plugin auto-detect your fields.

## FAQ

### Does this require the FormCraft plugin?

Yes, this plugin is specifically designed to seamlessly integrate with and enhance
FormCraft forms (both free and premium versions).

### How do I target a specific field in FormCraft?

Go to **FormCraft**, open your form, click on your target phone field, open **Field
Options**, and enter `phone-country-flag` in the **Extra Classes** field. You can
also customize this class name under **Settings > FormCraft Phone Flag**.

### How does country code auto-detection work?

When enabled, the plugin checks the visitor’s country code via browser GeoIP. The
result is cached in the visitor’s browser `localStorage` for 7 days so lookup happens
only once.

### Can I disable GeoIP auto-detection?

Yes. Uncheck the “Detect visitor’s country from IP address” option in **Settings
> FormCraft Phone Flag**, and the plugin will strictly use your configured Default
Country.

### Are any external CDN scripts loaded?

No. All required scripts, styles, and flag images are bundled directly within the
plugin to ensure fast loading times, offline support, and strict privacy compliance.

### Can I restrict the dropdown to only certain countries?

Yes. In **Settings > FormCraft Phone Flag**, enter a comma-separated list of 2-letter
ISO country codes in the “Only these countries” field (e.g., `us,gb,ca,in`).

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Phone Country Flag for FormCraft” is open source software. The following people
have contributed to this plugin.

Contributors

 *   [ Kanani Parth ](https://profiles.wordpress.org/kananiparth1326/)

[Translate “Phone Country Flag for FormCraft” into your language.](https://translate.wordpress.org/projects/wp-plugins/phone-country-flag-for-formcraft)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/phone-country-flag-for-formcraft/),
check out the [SVN repository](https://plugins.svn.wordpress.org/phone-country-flag-for-formcraft/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/phone-country-flag-for-formcraft/)
by [RSS](https://plugins.trac.wordpress.org/log/phone-country-flag-for-formcraft/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.0.0

 * Initial release: FormCraft phone field country flag dropdown, GeoIP auto-detection,
   and real-time validation.

## Meta

 *  Version **1.0.0**
 *  Last updated **10 hours ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 5.6 or higher **
 *  Tested up to **7.1.5**
 *  PHP version ** 7.4 or higher **
 * Tags
 * [country code](https://wordpress.org/plugins/tags/country-code/)[forms](https://wordpress.org/plugins/tags/forms/)
   [intl tel input](https://wordpress.org/plugins/tags/intl-tel-input/)[phone](https://wordpress.org/plugins/tags/phone/)
   [phone number](https://wordpress.org/plugins/tags/phone-number/)
 *  [Advanced View](https://wordpress.org/plugins/phone-country-flag-for-formcraft/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/phone-country-flag-for-formcraft/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/phone-country-flag-for-formcraft/reviews/)

## Contributors

 *   [ Kanani Parth ](https://profiles.wordpress.org/kananiparth1326/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/phone-country-flag-for-formcraft/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://pages.razorpay.com/pl_T7Kh8oN3Z8jAyN/view)