🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!
Guides & Tutorials October 13, 2026

How to Encrypt Sensitive Gravity Forms Fields and Mask Them in Entries with Secure Data Vault

GravityExtra
How to Encrypt Sensitive Gravity Forms Fields and Mask Them in Entries with Secure Data Vault

Some forms collect information you would never want to see in a leaked database: national ID numbers, dates of birth, medical details, home addresses, private phone numbers. Gravity Forms stores every answer as plain text, so anyone with database access, every backup file and every user who can open entries can read them.

This guide explains where that data is exposed, what your options are, and how the Gravity Forms Secure Data Vault Premium Add-on encrypts the fields you choose before they are saved, shows real values only to the people you allow, masks them for everyone else and logs every view, export and search.

Where Sensitive Form Data Is Exposed

Think about who can read a Gravity Forms entry on a typical site: administrators, editors with form permissions, the hosting company, anyone with a copy of a backup, a developer working on a staging copy, and any plugin with database access. For a contact form that may be acceptable. For a patient intake form, a tenancy application or an HR onboarding form, it usually is not.

Server-level disk encryption does not help here. It protects a stolen hard drive, not a database dump or a user account with too many permissions. What sensitive forms need is protection at the field level: the value is encrypted before it is stored, and only decrypted for people who are allowed to see it.

Places where plain-text answers end up
Database dumps and backups. Every backup holds a readable copy of every answer.
Staging copies. Cloned sites carry real personal data to less protected servers.
Shared admin accounts. Anyone who can view entries sees everything in them.
Exported spreadsheets. CSV files are emailed around and forgotten in downloads folders.

Your Options Today

1. Do not collect the data

The best protection is not to ask. When you must collect it, minimise it: ask for the last four digits instead of a full number where that is enough.

2. Restrict access with roles

Gravity Forms capabilities and role plugins control who can open entries. That limits screen access, but the data in the database and backups is still plain text.

3. Custom encryption code

A developer can encrypt values with PHP’s sodium functions in Gravity Forms hooks. Then come the hard parts: key storage, searching encrypted values, exports, privacy requests, key rotation and encrypting old entries without losing data. There are also third-party encryption plugins for Gravity Forms; compare how they store the key, handle search and log access before choosing one.

Comparison: Ways to Protect Sensitive Fields

Secure Data Vault add-on Plain Gravity Forms Role restrictions Custom code
Encrypted in database and backups Yes, chosen fields No No If you build it
Key outside the database Yes, wp-config.php Not applicable Not applicable Up to you
Masked values for other users Yes, ****1234 No Hides whole entry If you build it
Search encrypted values Exact match Not applicable Not applicable If you build it
Access log Views, exports, searches No No If you build it
Cost From $39/year (1 site) Included Usually free Developer time

What Secure Data Vault Does

Secure Data Vault uses libsodium authenticated encryption, built into PHP, with a key that lives in wp-config.php and never in the database.

  • Field-level encryption. Choose the fields per form: text, paragraph, email, phone, hidden, name, address, date, website, drop-down, radio buttons and number.
  • Real values for chosen people. Tick roles and add individual users who see real values; everyone else sees ****1234 or ********.
  • Exact-match search. Find entries by the full value through a keyed fingerprint index, ignoring case and extra spaces.
  • Protected exports. Exports contain real values only when the person exporting is allowed to see them.
  • Access log. Forms → PII Access Log records views, masked views, exports, searches and erasures, with CSV download.
  • Privacy requests. WordPress personal data export and erasure include protected values.
  • Command-line tools. Encrypt existing entries in batches with dry run, backup and restore, rotate the key and rebuild the search index with WP-CLI.
  • Masked notifications. Notifications and feeds receive masked values unless you choose otherwise.

Encryption is one layer of your privacy measures, alongside hosting, access rules and processes. It does not on its own make a site compliant with any regulation, and encrypted fields cannot be used for payments, user registration, calculations or conditional logic on saved entries.

How to Set It Up, Step by Step

You need WordPress 6.5 or higher, PHP 7.4 or higher with the sodium extension (standard since PHP 7.2), Gravity Forms 2.7 or higher, access to wp-config.php and an active GravityExtra license. WP-CLI is recommended.

Step 1: Install the add-on and add the key

Upload and activate the add-on and enter your license key under Forms → Settings → Encrypted Fields. Create a key with wp gfx-pii generate-key, add the printed define( 'GE_PII_KEY', ... ) line to wp-config.php above “That’s all, stop editing!” and save a copy in your password manager. Without the key, encrypted values cannot be read by anyone.

Reload the settings page: it shows “Encryption key found” and a short key ID. The key itself is never shown or stored in the database.

Step 2: Choose the fields and who may see them

Open the form and go to Settings → Encrypted Fields. Tick the fields to encrypt, the roles and users who see real values, and what everyone else sees. Choose whether notifications and feeds sent during the submission receive masked values (recommended) or real values, and whether to allow search. New submissions are encrypted from that moment on.

Form settings with the fields to encrypt, roles allowed to see real values, masking choice, submission option and search option
Fields to encrypt, allowed roles, masking, notification handling and search for one form.

Step 3: Check what different users see

Open an entry as an administrator and you see the real values. Log in as an editor who is not on the allowed list and the same entry shows masked values. If that editor edits the entry, the real values are kept. A Protected fields box on each entry shows which fields are encrypted.

The same entry for an editor who is not allowed: email, phone and ID masked
The same entry for an editor who is not allowed: email, phone and ID number are masked.

Step 4: Encrypt older entries and review the log

Entries saved before you installed the add-on stay as they were until you run wp gfx-pii encrypt --form=3 --dry-run and then the real command. It works in batches, writes a backup file first and skips values that are already encrypted. Move the backup off the server once you have checked the result.

Open Forms → PII Access Log to see who viewed real values, who saw masked values, and every export, search and erasure, with date, user, form, entry, fields and IP address.

PII Access Log with filters, CSV download and rows for searches, views and masked views
The PII Access Log with filters and CSV download.

Pro Tips for Production Forms

  • Store the key twice. Keep it in wp-config.php and in your password manager; losing it means losing the data.
  • Keep notifications masked. Only send real values to an email address or service that is allowed to receive them.
  • Rotate keys calmly. Move the current key to GE_PII_KEY_PREVIOUS, add the new one, run wp gfx-pii rotate, and remove the old key when status shows 0 values on it.
  • Use exact search for lookups. Searching a full phone number or ID still works, while partial “contains” searches return nothing on encrypted fields.
  • Review the log monthly. Unexpected real-value views are an early sign that a role has more access than it should.
Our recommendation

Start with the one form that holds the most sensitive answers. Add the key, encrypt only the truly sensitive fields, keep notifications masked and run the encrypt command on old entries with a dry run first. Then review the access log after a week.

Protect the Answers That Matter Most

Encrypt chosen Gravity Forms fields at rest, show real values only to the people you choose, mask them for everyone else and log every access. Plans start at $39/year for one site, $69 for five sites and $149 for ten.

or read the Secure Data Vault setup guide

Frequently Asked Questions

What happens if I lose the key?

Encrypted values cannot be read by anyone, including us. Keep a copy of the key in your password manager.

Can I search encrypted fields?

Yes, by exact value. The add-on stores a keyed fingerprint of each value, so full-value searches work while partial searches do not.

Do exports contain real values?

Only when the person exporting, or the export profile owner, is allowed to see them. Otherwise the encrypted value is exported.

Can I go back to plain values?

Yes. Run wp gfx-pii decrypt before removing the add-on.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr