# Verify emails on WordPress forms and WooCommerce

Source: https://docs.rocketverifier.com/integrations/wordpress

> Install the RocketVerifier plugin, paste your API key under Settings, RocketVerifier, and every supported form checks the email as the visitor types and again on the server when the form is submitted. Undeliverable and disposable addresses are rejected, and one cached result covers both checks, so each address uses a single credit.

The RocketVerifier plugin protects every form on a WordPress site. Each supported form plugin gets a server-side check on submit, so a blocked address never gets through, even with JavaScript turned off.

## Install the plugin

**Step 1. Install and activate**

In WordPress admin open **Plugins, Add New**, search for **RocketVerifier**, then click **Install Now** and **Activate**. To install by hand, upload the `rocketverifier` folder to `/wp-content/plugins/` and activate it on the Plugins screen.

**Step 2. Paste your API key**

Open **Settings, RocketVerifier**, paste a key from [API keys](https://app.rocketverifier.com/dashboard/api-keys) and click **Save Settings**. The page shows **Connected** and your credit balance.

**Step 3. Choose what to block**

Pick the validation options and form integrations below. Protection starts with the next submission.

## Choose what to block

| Setting | Default | What it does |
| --- | --- | --- |
| Block invalid emails | On | Rejects `undeliverable` addresses: mailboxes that do not exist, domains that cannot receive mail and broken syntax. |
| Block disposable emails | On | Rejects temporary and throwaway addresses. |
| Enable real-time validation | On | Checks the address as the visitor types and shows the result under the field. |
| Block submissions when the verification service is unavailable | Off | Rejects submissions when the API cannot be reached, returns an error or your credits run out. Leave it off so forms keep working. |

`deliverable`, `risky` and `unknown` addresses are accepted. When the API flags a typo, the message suggests the corrected address, for example "Did you mean name@gmail.com?".

## Supported forms

Each integration turns on when its form plugin is active and has its own switch under **Form Integrations**.

| Form | Server-side check |
| --- | --- |
| Contact Form 7 | Required and optional email fields. |
| Gravity Forms | Email fields. |
| WPForms | Email fields. |
| Ninja Forms | Email fields. |
| WooCommerce checkout | The billing email, on the classic and the block checkout. |
| WooCommerce My Account registration | The registration email. |
| Any other HTML form | Live check only: add `data-rv-email` to the input. |

HTML:

```html
<input type="email" name="email" data-rv-email />
```

The live check runs on every `type="email"` input, every input with `data-rv-email`, and the email fields of Contact Form 7 and Gravity Forms.

## Credits and caching

- 1 credit per verified address. `unknown` results are free.
- Results are cached for 10 minutes per address, so the live check and the submission count once. Failed and `unknown` results are not cached.
- The public live-check endpoint allows 10 checks per visitor per 60 seconds, which keeps bots from spending your credits.

## Customize with filters

Developers can tune the plugin with WordPress filters:

| Filter | Default | Use it to |
| --- | --- | --- |
| `rocketverifier_rate_limit` | `10` | Change live checks per visitor per window. Return `0` to turn the limit off. |
| `rocketverifier_rate_limit_window` | `60` | Change the window in seconds. |
| `rocketverifier_client_ip` | `REMOTE_ADDR` | Supply the visitor IP behind a proxy or CDN. |
| `rocketverifier_cache_ttl` | `600` | Change the cache lifetime in seconds. Return `0` to turn caching off. |
| `rocketverifier_request_timeout` | `30` | Change the HTTP timeout for API calls in seconds. |
| `rocketverifier_block_reason` | | Return `''` to allow a result, or a reason code to block it. Receives the API response. |
| `rocketverifier_validation_message` | | Rewrite the message shown to the visitor. |
| `rocketverifier_ninja_forms_is_email_field` | | Treat other Ninja Forms field types as email fields. |

PHP:

```php
// Also block role addresses such as info@ and sales@.
add_filter('rocketverifier_block_reason', function ($reason, $verification) {
    if ($reason === '' && ($verification['account']['role'] ?? '') === 'yes') {
        return 'invalid';
    }
    return $reason;
}, 10, 2);
```

The API returns flags such as `account.role` as the strings `"yes"`, `"no"` or `"unknown"`, so compare them explicitly. See the [verification result](https://docs.rocketverifier.com/api/verify#response).

## Frequently asked questions

### What happens if the API cannot be reached?

Submissions go through without verification, so your forms and checkout keep working during an outage or when credits run out. Turn on Block submissions when the verification service is unavailable to reject them instead.

### Does the live check and the submit check cost two credits?

No. Each result is cached for 10 minutes per address, so checking while the visitor types and again on submit uses one credit. Unknown results are free and are never cached.

### Is my API key exposed to visitors?

No. The browser talks to your own WordPress site through admin-ajax, and only the server calls the RocketVerifier API with the key.

### Can I verify a custom form?

Add `data-rv-email` to its email input for the live check. Server-side checks run for the supported form plugins and WooCommerce.
