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

  1. In WordPress Admin go to Plugins → Add New and search for IsValid – Data Validation.
  2. Activate the plugin.
  3. Go to Settings → IsValid and paste your API key.
  4. Click Test Connection to verify the key works, then click Save Changes.
A free API key (100 validations/day) is available at isvalid.dev. No credit card required.

Settings

All options are at Settings → IsValid.

SettingDefaultDescription
API KeyYour isvalid.dev API key. Stored server-side, never sent to the browser.
Enable CacheOnCache validation results using the WordPress Transients API to reduce API usage.
Cache TTL3600 sHow long each result is cached (60–86400 seconds). Override per validator type with the isvalid_cache_ttl_for_type filter.
Validate OnBlurWhen to trigger validation: on blur (user leaves the field) or on input (while typing, debounced).
Debounce Delay600 msDelay after the user stops typing before validation fires. Only applies when Validate On = Input.
Rate Limit30 req/minMaximum 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

AttributeExampleDescription
data-isvalid-errorInvalid IBAN formatCustom error message shown when validation fails.
data-isvalid-successIBAN is validCustom success message shown when validation passes.
data-isvalid-country-codePLPass countryCode to the API (supported by iban, phone, postal-code, vat).
data-isvalid-check-mxtrueEnable MX record check for the email validator.
data-isvalid-check-viestrueEnable 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

AttributeExampleDescription
typeibanValidator type (required). Any slug accepted by the isvalid.dev API.
nameiban_numberHTML input name attribute (required).
labelIBAN numberLabel text shown above the input.
idmy-ibanCustom HTML id. Auto-generated if omitted.
placeholderPL61 1090…Input placeholder text.
required(no value)Marks the field as required (adds HTML required attribute).
classmy-classExtra CSS classes added to the input element.
input_typetextUnderlying HTML input type: text, email, tel, url, number, password.
error_messageInvalid IBANCustom error message shown when validation fails.
showbankName:Bank,countryName:CountryComma-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.

EventFired whenSecond argument
isvalid:validValidation passedFull API response object
isvalid:invalidValidation failedFull API response object
isvalid:errorNetwork or proxy errorjqXHR.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]
OptionDescription
isvalid-type:ibanValidator 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).
Server-side validation runs even if JavaScript is disabled. The form will not submit if the value is invalid.

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 fieldValidator
billing_email / shipping_emailemail
billing_phone / shipping_phonephone
billing_postcode / shipping_postcodepostal-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;
} );
When the API is unreachable the plugin fails open — checkout proceeds normally so that API downtime never blocks legitimate orders.

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/pesel

This 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.

The dropdown is available on field types: text, email, url, tel, number, phone, address.

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

ClassWhen applied
isvalid-loadingRequest in flight
isvalid-validAPI returned valid: true
isvalid-invalidAPI returned valid: false
isvalid-errorNetwork 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

FilterDescription
isvalid_woo_field_mapOverride the WooCommerce checkout field → validator type mapping.
isvalid_cache_ttl_for_typeOverride 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/validate

Request 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.