🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

Gravity Forms Phone Lookup Premium Add-on Setup Guide

Updated 9 min read Gravity Forms Fields & Inputs
On this page
  1. Video walkthrough
  2. What it does, and what it does not do
  3. What you need
  4. Step 1: install and activate
  5. Step 2: choose the provider and save its keys
  6. Behaviour
  7. Step 3: switch it on for a form
  8. Block these numbers
  9. Save the result in fields
  10. Merge tags
  11. What happens on every submission
  12. Security and privacy
  13. For developers
  14. Troubleshooting
  15. Frequently asked questions
  16. Does it send a text message or call the number?
  17. Does it prove that the visitor owns the number?
  18. What does a lookup cost?
  19. Will a good visitor ever be blocked by a mistake?
  20. Does it check numbers that are already in my entries?
  21. Which Gravity Forms versions does it support?

Video walkthrough

Gravity Forms Phone Lookup Add-On Setup Guide: Provider, Hourly Limit and Blocking (WordPress Side)
Video setup guide: Gravity Forms Phone Lookup Watch on YouTube

The Gravity Forms Phone Lookup Premium Add-on checks the phone number a visitor types when a Gravity Forms form is submitted. It asks your own Twilio Lookup, Numverify or Abstract Phone Validation account whether the number is real, what kind of line it is (mobile, landline or VoIP) and which carrier it belongs to. The answer is saved into form fields and merge tags, and you can optionally refuse invalid, VoIP or landline numbers before an entry is created.

What it does, and what it does not do

Phone Lookup is a validation through a carrier database. It is a different job from two other GravityExtra add-ons that also deal with phone numbers:

  • International Phone Mask formats the number while the visitor types and checks its shape in the browser. It makes no request to any service and knows nothing about line type or carrier.
  • Verification & Account Tools sends a one-time code by text message or email to prove that the visitor holds the number. It does not look up the line type or the carrier.
  • Phone Lookup asks a lookup service, when the form is submitted, whether the number exists and what it is. It does not send a message to the number.

The three can be used together: the mask makes the number tidy, Phone Lookup refuses numbers you do not want, and a verification code proves ownership as the last step.

What you need

  • WordPress 6.5 or newer and PHP 7.4 or newer.
  • Gravity Forms 2.9 or newer. The add-on is tested with Gravity Forms 3.1.2 on PHP 8.3 and Gravity Forms 2.9.8 on PHP 7.4.
  • An account with one of the three providers: Twilio Lookup (version 2), Numverify, or Abstract Phone Validation (version 1). Every lookup uses a lookup of your own account and quota.
  • A GravityExtra license key for the add-on.

Nothing goes through GravityExtra. The number is sent from your server straight to the provider you choose, over HTTPS with certificate checks on.

Step 1: install and activate

  1. Upload and activate the add-on in Plugins.
  2. Open Forms → Settings → Phone Lookup.
  3. Enter your license key and press Activate License. Without an active license nothing is looked up, nothing is blocked and no value is saved.

Step 2: choose the provider and save its keys

Pick the provider in Provider and fill in only that provider’s fields.

  • Twilio Lookup. Enter the Account SID and the Auth Token, or an API key SID and its secret. The add-on calls Lookup version 2 and asks for the Line Type Intelligence data, which carries the line type and the carrier name. Check in your Twilio console that your account may use that data package.
  • Numverify. Enter the access key. Choose the key type: a key from the Numverify dashboard, which needs a paid plan to be used over HTTPS, or a key from the APILayer Marketplace, which is used over HTTPS on every plan and travels in a header. The add-on never sends a key over plain HTTP.
  • Abstract. Enter the API key of the Phone Validation API. Each Abstract API has its own key.

Secrets are encrypted with AES-256-GCM before they are saved, with a key made from your site’s own salts, so a copy of the database alone cannot read them. They are never shown again: the field stays empty, and leaving it empty when you save keeps the stored value. If your server has no OpenSSL with AES-256-GCM, nothing is stored and the screen says so; you can then define GEPL_TWILIO_TOKEN, GEPL_NUMVERIFY_KEY or GEPL_ABSTRACT_KEY in wp-config.php instead.

The Phone Lookup settings screen in Gravity Forms: the license box, the lookup account section with the provider choice and the encrypted key fields, and the behaviour section with the fail-open choice, default country code, remember time and hourly limit
The add-on settings: your own provider account, keys stored encrypted, and what to do when the lookup is not available.

Behaviour

  • If the lookup is not available. The default, Let the form through, keeps the form working when the provider is down, the quota is used up, a key is wrong or the hourly limit is reached. The visitor is never punished for a problem on the provider side, and the entry gets a note with the reason. Choose Block the form only if a checked number matters more than the sign-up.
  • Default country code. Digits only, for example 1 or 44. It completes numbers typed without a country code. A number that starts with + or 00 is used as it is.
  • Remember a result for (days). The same number is not looked up again during this time, which saves your quota. A value of 0 keeps a result for ten minutes, long enough for a form with several pages. The maximum is 30 days.
  • New lookups per visitor and hour. A bot that submits numbers all day would use your quota. This limit counts only real requests; remembered results do not count. Zero turns it off.

Step 3: switch it on for a form

  1. Open the form and go to Settings → Phone Lookup.
  2. Turn on Look the number up when the form is submitted.
  3. Choose the Phone field.
  4. Tick what to block, if anything, and adjust the messages.
  5. Choose the fields that should receive the answer, and save.
The Phone Lookup tab of a form: the phone field, the options to block invalid, VoIP and landline numbers, the messages and the five fields that receive the line type, carrier, valid flag, country and international number
Per form: which field to check, which numbers to block, and where to save the answer.

Block these numbers

Nothing is blocked unless you tick it.

  • Invalid numbers. The provider says the number does not exist, or the typed text is not a phone number at all. Text that cannot be a number is refused without spending a lookup.
  • VoIP numbers. Fixed and non-fixed internet numbers. Blocking is applied only when the provider reports the line as VoIP.
  • Landline numbers. Useful when you need a mobile number, for example for text messages.

A number whose line type the provider could not tell is never blocked as VoIP or landline. Toll-free, premium-rate and other special lines pass unless you change the decision with the filter described below. Each case has its own message, which you can write in your own words; the visitor sees it under the phone field.

Save the result in fields

Choose any Single Line Text or Hidden field for each item you want to keep. The values are written when the entry is saved, before notifications and feeds run, so a notification or a CRM feed can use them at once.

  • Line type is saved as a code: mobile, landline, voip, toll_free, premium, other or unknown.
  • Carrier is the carrier name the provider returned. It is empty when the provider or your plan does not return it.
  • Valid is yes or no.
  • Country is the two-letter country code.
  • Number is the number in international format with a plus sign.

Merge tags

You can also use the answer anywhere merge tags work after the entry exists, such as notifications and confirmations:

  • {phone_lookup:line_type} and {phone_lookup:line_type_label} (for example Mobile or VoIP)
  • {phone_lookup:carrier}
  • {phone_lookup:valid} (yes or no)
  • {phone_lookup:country}
  • {phone_lookup:number} (international) and {phone_lookup:national}
  • {phone_lookup:status}: checked, invalid or error

A tag with no answer, for instance because the lookup was not available, is replaced by nothing. The tags are in the merge tag list of the form editor.

What happens on every submission

  • Gravity Forms validates the phone field as usual. If it already fails, nothing else happens.
  • The add-on turns the typed value into an international number. A value that is not a phone number is invalid at once.
  • It looks for a remembered answer for that number and provider. If there is none, it checks the hourly limit and asks the provider.
  • It applies your blocking choices and shows the matching message, or lets the form through.
  • When the entry is saved it writes the answer into the chosen fields and into a note with the number masked to its last four digits.
A Gravity Forms entry screen with the mapped fields filled with a line type and a carrier, and a note that says the number is valid, with its line type, carrier and country
The entry keeps the answer: the mapped fields and a note with the masked number.

Security and privacy

  • Keys are stored encrypted and never printed back. Error messages and notes never contain a key.
  • Requests use HTTPS with certificate checks on, with no redirects followed.
  • The number is sent to the provider you choose, and to nobody else. Tell people on the form that their number is checked, and read the privacy terms of your provider.
  • A remembered answer is stored in a temporary WordPress option, named by a hash of the provider and number. It holds the number in international format and the answer, and it expires after the days you set.
  • Uninstalling the add-on removes its settings, the encrypted keys and the remembered answers. Entries, notes and saved field values stay.

For developers

  • gfphonelookup_result changes the answer before it is used and remembered, for example to treat one carrier as VoIP.
  • gfphonelookup_block_reason changes the decision: an empty text lets the number through, and invalid, voip or landline refuses it.
  • gfphonelookup_timeout changes the request timeout in seconds. The default is 8.
  • gfphonelookup_request_args changes the request arguments. Do not log them: they can hold a key.
  • The entry meta key gfphonelookup_result holds the saved answer.

Troubleshooting

  • The note says the key or credentials were refused. Copy the key again from your provider, and paste it into the empty field. For Numverify check the key type.
  • The note says the quota is reached or the rate limit. Your plan at the provider is used up. Raise the remember time to save lookups.
  • Line type is unknown or the carrier is empty. Your provider or plan does not return that data for this number or country.
  • VoIP numbers pass although VoIP is blocked. The provider did not report the line as VoIP. Twilio reports fixed and non-fixed VoIP; check what your provider documents.
  • Nothing happens. Check that the license is active, the form switch is on and a phone field is chosen.
  • The hourly limit note appears for real visitors. Many visitors share one address, for instance behind an office network. Raise the limit.

Every one of these reasons is written to the entry notes, so you do not need to read a log file.

Frequently asked questions

Does it send a text message or call the number?

No. A lookup asks a database about the number. Nobody is contacted.

Does it prove that the visitor owns the number?

No. It tells you the number exists and what kind of line it is. To prove ownership use a one-time code, for example with the GravityExtra Verification & Account Tools add-on.

What does a lookup cost?

Whatever your provider charges. The add-on adds nothing. Remembered answers and the hourly limit keep the number of lookups down.

Will a good visitor ever be blocked by a mistake?

Carrier data is not perfect, and numbers are ported between carriers. Start with blocking invalid numbers only, and add VoIP or landline blocking when you are sure that you need it. The messages should tell people what to do next.

Does it check numbers that are already in my entries?

No. A number is checked when a form is submitted.

Which Gravity Forms versions does it support?

Gravity Forms 2.9 and newer. It is tested with Gravity Forms 3.1.2 on PHP 8.3 and Gravity Forms 2.9.8 on PHP 7.4.

See the Phone Lookup add-on

Still need help?

Our support team answers tickets every day, usually within a few hours.

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