IsValid – Data Validation
The IsValid – Data Validation plugin connects any WordPress site to the isvalid.dev validation API. It supports 80+ validator types — including IBAN, VAT, email, phone, postal code, ISIN, PESEL and more — and integrates with the most popular form plugins.
All calls to api.isvalid.dev are made from your WordPress server, not the visitor's browser. Your API key is stored in the WordPress database and never appears in page source or JavaScript.
Installation
- In WordPress Admin go to Plugins → Add New and search for IsValid – Data Validation.
- Activate the plugin.
- Go to Settings → IsValid and paste your API key.
- Click Test Connection to verify the key works, then click Save Changes.
Settings
All options are at Settings → IsValid.
| Setting | Default | Description |
|---|---|---|
| API Key | — | Your isvalid.dev API key. Stored server-side, never sent to the browser. |
| Enable Cache | On | Cache validation results using the WordPress Transients API to reduce API usage. |
| Cache TTL | 3600 s | How long each result is cached (60–86400 seconds). Override per validator type with the isvalid_cache_ttl_for_type filter. |
| Validate On | Blur | When to trigger validation: on blur (user leaves the field) or on input (while typing, debounced). |
| Debounce Delay | 600 ms | Delay after the user stops typing before validation fires. Only applies when Validate On = Input. |
| Rate Limit | 30 req/min | Maximum proxy requests per visitor IP per minute. Set to 0 to disable. |
Generic — data-isvalid attribute
Add data-isvalid="type" to any <input> element on the page. The plugin will automatically bind real-time validation to it. Use a Custom HTML block in the Gutenberg editor to add raw HTML.
<input type="text" data-isvalid="iban" name="iban_number" />The validator type is the API endpoint slug — the same values accepted by /v0/{type}. Examples: email, phone, iban, vat, postal-code, pl/pesel, net/ip, etc.
Optional data attributes
| Attribute | Example | Description |
|---|---|---|
| data-isvalid-error | Invalid IBAN format | Custom error message shown when validation fails. |
| data-isvalid-success | IBAN is valid | Custom success message shown when validation passes. |
| data-isvalid-country-code | PL | Pass countryCode to the API (supported by iban, phone, postal-code, vat). |
| data-isvalid-check-mx | true | Enable MX record check for the email validator. |
| data-isvalid-check-vies | true | Enable VIES live check for the vat validator. |
Shortcode — [isvalid_input]
Use the [isvalid_input] shortcode inside a Shortcode block in the Gutenberg editor, or anywhere shortcodes are supported. It renders a labelled input with built-in validation and an optional set of read-only output fields populated from the API response.
[isvalid_input type="iban" name="iban_number" label="IBAN" required]With output fields
The show attribute renders additional read-only fields below the input. After successful validation they are automatically filled with values from the API response. Use dot notation for nested fields (e.g. vies.name).
[isvalid_input
type="iban"
name="iban_number"
label="IBAN"
show="bankName:Bank name,countryName:Country,bankBic:BIC"
required
]All attributes
| Attribute | Example | Description |
|---|---|---|
| type | iban | Validator type (required). Any slug accepted by the isvalid.dev API. |
| name | iban_number | HTML input name attribute (required). |
| label | IBAN number | Label text shown above the input. |
| id | my-iban | Custom HTML id. Auto-generated if omitted. |
| placeholder | PL61 1090… | Input placeholder text. |
| required | (no value) | Marks the field as required (adds HTML required attribute). |
| class | my-class | Extra CSS classes added to the input element. |
| input_type | text | Underlying HTML input type: text, email, tel, url, number, password. |
| error_message | Invalid IBAN | Custom error message shown when validation fails. |
| show | bankName:Bank,countryName:Country | Comma-separated list of API response fields to display as read-only fields. Format: field:Label or just field. |
Example — phone number with output
[isvalid_input
type="phone"
name="phone"
label="Phone number"
show="e164:E.164 format,type:Type,countryCode:Country"
]Example — VAT with VIES check
[isvalid_input
type="vat"
name="vat_number"
label="VAT number"
show="normalized:Normalised,vies.name:Company name,vies.address:Address"
]JavaScript events
The validator fires custom jQuery events on the input element after each validation attempt. Use them to build custom UI behaviour without modifying the plugin.
| Event | Fired when | Second argument |
|---|---|---|
| isvalid:valid | Validation passed | Full API response object |
| isvalid:invalid | Validation failed | Full API response object |
| isvalid:error | Network or proxy error | jqXHR.responseJSON |
jQuery('#my-input').on('isvalid:valid', function(e, result) {
console.log(result.bankName); // e.g. "PKO Bank Polski"
jQuery('#bank-name').val(result.bankName);
});
jQuery('#my-input').on('isvalid:invalid', function(e, result) {
console.log('Invalid value');
});You can also call the validator programmatically via window.IsValidValidator.validate($input, type, value, params).
Contact Form 7 integration
The plugin registers a custom [isvalid] field tag. Add it to your CF7 form in the form editor. Both real-time JS validation and server-side validation (before the email is sent) are performed automatically.
Field tag syntax
[isvalid iban* billing-iban isvalid-type:iban placeholder "PL61 1090…"]
[isvalid email* your-email isvalid-type:email]
[isvalid phone your-phone isvalid-type:phone]| Option | Description |
|---|---|
| isvalid-type:iban | Validator type (required). Any slug accepted by the isvalid.dev API. |
| error-message:"…" | Custom validation error message shown in the form. |
| * (asterisk) | Makes the field required (standard CF7 convention). |
WooCommerce integration
The plugin automatically validates standard checkout fields. Real-time JS validation is added via the data-isvalid attribute injected into WooCommerce field HTML. Server-side validation blocks order placement if a value is invalid.
Default field map
| WooCommerce field | Validator |
|---|---|
| billing_email / shipping_email | |
| billing_phone / shipping_phone | phone |
| billing_postcode / shipping_postcode | postal-code |
Adding custom fields
Use the isvalid_woo_field_map filter to add or override field mappings.
add_filter( 'isvalid_woo_field_map', function( $map ) {
$map['billing_vat_number'] = 'vat';
$map['billing_iban'] = 'iban';
return $map;
} );Gravity Forms integration
Two complementary approaches are available:
1. IsValid Field (custom field type)
Add the IsValid Field from the GF field library. In the field settings, select the validator type from the Validator Type dropdown. Both real-time and server-side validation are performed automatically.
2. CSS class convention
Add a CSS class isvalid-{type} to any existing text/email field via the field's Advanced → CSS Class option in the Form Editor. Examples:
isvalid-iban
isvalid-vat
isvalid-phone
isvalid-pl/peselThis approach requires no custom field type and works on all standard GF field types.
WPForms integration
Open any text, email, phone or number field in the WPForms builder. In the Advanced tab you will find an IsValid Validator Type dropdown. Select the validator type to enable real-time JS validation and server-side validation for that field.
Styling
The plugin loads isvalid-validation.css on all front-end pages where an API key is configured. Inputs inside .isvalid-field-wrap are set to width: 100% by default.
State classes on the input element
| Class | When applied |
|---|---|
| isvalid-loading | Request in flight |
| isvalid-valid | API returned valid: true |
| isvalid-invalid | API returned valid: false |
| isvalid-error | Network or proxy error |
Override example
/* Narrow inputs to 50% width */
.isvalid-field-wrap input {
width: 50%;
}
/* Custom valid border colour */
input.isvalid-valid {
border-color: #1a7f4b !important;
}PHP filters & hooks
| Filter | Description |
|---|---|
| isvalid_woo_field_map | Override the WooCommerce checkout field → validator type mapping. |
| isvalid_cache_ttl_for_type | Override the cache TTL (seconds) for a specific validator type. |
isvalid_cache_ttl_for_type
add_filter( 'isvalid_cache_ttl_for_type', function( $ttl, $type ) {
// Cache IBAN for 24 hours; always re-check domain DNS
if ( $type === 'iban' ) return 86400;
if ( $type === 'domain' ) return 0;
return $ttl;
}, 10, 2 );REST API proxy
The plugin registers a single WordPress REST endpoint that the browser calls instead of api.isvalid.dev directly:
POST /wp-json/isvalid/v1/validateRequest body (JSON)
{
"nonce": "0d77d766ee",
"type": "iban",
"value": "PL61109010140000071219812874",
"params": { "countryCode": "PL" }
}Security
- Nonce verification (
isvalid_validate) on every request. - Type validated against a hardcoded allowlist of ~80 known slugs — arbitrary paths are rejected.
- Per-IP rate limiting (configurable, default 30 req/min).
- The API key is never included in any response or page source.