Field Privacy

Encrypt Social Security numbers and other sensitive Gravity Forms fields in the database, show masked values in emails, and redact the full value once you are done with it.

Overview

The Gravity Forms Field Privacy Add-On encrypts the fields you mark before an entry is saved, so Social Security numbers, dates of birth, license numbers and addresses are no longer stored as plain text. Values are encrypted with libsodium using a key you keep in wp-config.php.

Logged-in reviewers still see the full value on the entry screen and in the Gravity Flow inbox, with an Encrypted label on each protected field. Notifications, merge tags and PDFs built from merge tags show a mask for the field type instead, such as ***-**-6789.

When the full value is no longer needed, a Gravity Flow step or any successful add-on feed replaces it with its mask for good, and an entry note records what triggered it.

Key Benefits

  • Encrypt sensitive fields at rest with an Encrypt at rest setting on each field.
  • Choose Masked, Hidden or Full value for how each field appears in emails and PDFs.
  • Masks match the field type: the last four digits of a Social Security number, a partial email, a starred date, or the last four characters of other text.
  • Keep No Duplicates working on encrypted fields, with a duplicate message that never repeats the submitted value.
  • Redact privacy fields after a Gravity Flow step, or after another add-on’s feed succeeds, such as Webhooks or a CRM.
  • Generate the encryption key from the settings page, with clear warnings when the key is missing or invalid.

How It Works

Open Forms → Settings → Field Privacy and click Generate encryption key. Copy the line it shows into wp-config.php, and keep a copy of the key somewhere safe.

In the form editor, select a sensitive field, open the Advanced tab, tick Encrypt at rest, and choose what Emails and PDFs show. Each encrypted field gets an Encrypted label, and a notice at the top of the editor counts them.

When someone submits the form, marked values are encrypted before they are saved. Reviewers see the full values on the entry, and notifications use each field’s mask.

To remove the full value later, add a Redact privacy fields step to a Gravity Flow workflow, or tick Redact privacy fields after this feed succeeds on another add-on’s feed. Redacted fields keep their mask and show a Redacted label.

Provide feedback here

Requirements

  • WordPress 6.5 or later
  • PHP 7.4 or later with the sodium extension
  • Gravity Forms 2.9.24 or later
  • Gravity Flow, to redact after a workflow step (optional)

Changelog

0.1.0-alpha.1

  • Added a form editor notice when one or more fields are encrypted at rest.
  • Added a Generate encryption key button on the Field Privacy settings page.
  • Added a one-line explanation to redact settings on feeds and Flow steps.
  • View more

Changelog — gravityforms/gravityformsfieldprivacy

0.1.0-alpha.1

  • Added a form editor notice when one or more fields are encrypted at rest.
  • Added a Generate encryption key button on the Field Privacy settings page.
  • Added a one-line explanation to redact settings on feeds and Flow steps.
  • Added an Encrypted label to encrypted fields in the form editor, and Encrypted or Redacted labels on the entry detail page and Gravity Flow inbox.
  • Fixed address masks: street lines are hidden, the ZIP shows its last two digits, and mixed text is no longer shown in the Social Security number pattern.
  • Fixed ciphertext copied from the database being decrypted when it was submitted in a form field or a Save and Continue draft.
  • Fixed encryption key generation errors not being shown on the settings page.
  • Fixed No Duplicates hashes not updating when an entry is changed with the REST API or GFAPI.
  • Fixed No Duplicates on encrypted fields by matching on a keyed hash instead of the ciphertext.
  • Fixed redacted dates showing as // and redacted addresses linking to Google Maps on the entry detail and entry list.
  • Fixed redacted values being re-encrypted, Full value fields being written back in plain text, and hidden address inputs being skipped; redaction now adds an entry note.
  • Fixed redaction being recorded as complete when values could not be decrypted; the entry note now says how many values were left unchanged.
  • Fixed Save and Continue drafts storing address and other multi-input privacy values in plain text.
  • Fixed values of four characters or fewer being shown in full by the Masked option.
  • Fixed values that contain *** or • being sent in emails without their mask.
  • Initial Labs release: encrypt marked fields at rest, mask them in emails and PDFs, and redact them after a Gravity Flow step or a successful feed.
  • Removed the Save Settings button from the Field Privacy settings page, which has nothing to save.
  • Replaced the browser confirmation on the Generate encryption key button with an inline confirmation.
  • Updated masked privacy values so the pattern matches the field type (Social Security number, email, date, phone, and other text).
  • Updated pricing fields so they can no longer be marked for encryption.
  • Updated the Field Privacy settings and admin notices so an invalid encryption key is distinguished from a missing key.
  • Updated the Gravity Flow redact checkbox so it appears above Next Step and runs when the step is processed.
  • Updated the No Duplicates message for privacy fields so it no longer repeats the submitted value.
  • Updated uninstall to remove No Duplicates hashes and the redacted flag on every site.

Documentation

Field Privacy Add-On Documentation


Requirements, filters, and limits are covered above. These are the core flows once the plugin is active, using a rental application that collects a Social Security number for a background check.

Create the encryption key

Open Forms → Settings → Field Privacy and click Generate encryption key.

Field Privacy settings with a No encryption key found warning, the Generate encryption key button, and a define line for wp-config.php with a Copy button

  • Copy the line into wp-config.php above the stop editing comment, then reload the page.
  • The key is shown once. Store a copy in a password manager.

Once the constant is in place the page confirms it. There is nothing else to set here.

Field Privacy settings with the Gravity Labs notice and a green Encryption key is defined message

Mark fields to encrypt

Select a field in the form editor and open the Advanced tab. Tick Encrypt at rest and pick what Emails and PDFs show.

Advanced tab for the Social Security Number field with Encrypt at rest checked and Emails and PDFs set to Masked

  • Masked is the default. Use Hidden for values nobody should see in an email (a license number), Full value for values that are fine in emails but shouldn’t sit in the database as plain text (income).
  • Every encrypted field gets an Encrypted label on the canvas, and a notice at the top of the editor counts them.

Social Security Number field on the form editor canvas with an Encrypted label next to its name

Form editor notice saying 6 fields are encrypted, with Encrypted labels next to each protected field

Review an entry

Submissions look normal to the person filling out the form. Logged-in reviewers see the full value on the entry detail screen and in the Gravity Flow inbox, with an Encrypted label on each protected field.

Entry detail showing the full phone, date of birth, Social Security number, license number, income and address, each with an Encrypted label

  • In the database the same values are stored as gffp:v1:… ciphertext.
  • If a value shows as gffp:v1:… here, the key is missing or wrong. Check the settings page.

Check what emails show

Notifications built with {all_fields} or individual merge tags show each field’s mask. You don’t need to change your notifications.

Landlord notification email with a masked phone, starred date of birth, SSN ending 6789, license shown as redacted and an address with the street hidden

Block duplicate submissions

Turn on No Duplicates in the field’s General settings as usual.

Rules section of the General tab with No Duplicates checked

A second submission with the same value is refused, and the message doesn’t repeat the value back.

Social Security Number field with the validation message This value has already been used

Redact after review (Gravity Flow)

Add your review step (for example an Approval step), then add a step and choose Redact privacy fields.

Gravity Flow step settings with the Redact privacy fields step type selected and its description

Or tick Redact privacy fields after this step is processed on the review step itself:

Approval step settings with the Field Privacy checkbox Redact privacy fields after this step is processed

Redact after a feed succeeds

Without Gravity Flow, open any other add-on’s feed (Webhooks, a CRM) and tick Redact privacy fields after this feed succeeds. Use it when the full value only needs to reach one outside service.

Webhooks feed settings with a Field Privacy section and Redact privacy fields after this feed succeeds checked

  • Redaction runs only when the feed reports success. A failed feed leaves the values alone so it can be retried.

After redaction

The entry keeps the masks and the labels change to Redacted. Hidden fields are removed, and Full value fields stay encrypted.

Entry detail after redaction with Redacted labels on the masked phone, date, SSN and address, and Monthly Income still marked Encrypted

An entry note records when it happened and what triggered it:

Entry notes: Landlord Review approved, then Privacy fields redacted by the workflow step Redact Sensitive Fields