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

Gravity Forms ALTCHA Spam Protection Premium Add-on Setup Guide

Updated 10 min read Gravity Forms Integrations A–Z
On this page
  1. Video walkthrough
  2. What you need
  3. How the check works
  4. Install and activate
  5. Add the field to a form
  6. Field settings
  7. The settings page
  8. How hard the puzzle is
  9. Defaults and texts
  10. Test
  11. Statistics
  12. Secret
  13. What happens with the entry
  14. AJAX, multi-page, Save and Continue, caching and several forms
  15. Privacy and GDPR
  16. Accessibility
  17. For developers
  18. Troubleshooting
  19. Frequently asked questions
  20. Do I need an account or an API key?
  21. Does it work without HTTPS?
  22. Can I use it on forms next to another CAPTCHA?
  23. Is there a Sentinel or cloud mode?
  24. What does it cost visitors?

Video walkthrough

Gravity Forms ALTCHA Spam Protection: Self-Hosted Proof-of-Work Spam Check, No Keys or Account
Watch the ALTCHA Spam Protection add-on check visitors with a self-hosted proof-of-work puzzle and refuse replayed bot requests. Watch on YouTube

The Gravity Forms ALTCHA Spam Protection Premium Add-on adds an ALTCHA field to Gravity Forms. ALTCHA is an open-source proof-of-work check: the visitor’s browser solves a small cryptographic puzzle in the background, and your own website makes and verifies that puzzle. There is no key to create, no account, no outside service, no cookie and no tracking, and nobody has to click traffic lights or read bent letters. A bot that sends thousands of forms has to solve thousands of puzzles.

The add-on bundles the ALTCHA widget (version 2.3.0, MIT licence) and serves it from your own site, so a page with the field talks only to your own server. This guide shows how to set it up, what every setting does and how the check works with AJAX forms, multi-page forms, Save and Continue, page caching and several forms on one page.

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.
  • A site on HTTPS. The widget needs the browser’s Web Crypto API, and browsers only offer it on HTTPS pages (and on localhost). On a plain HTTP site the settings page and the form editor show a notice, and visitors would not be able to pass the check.
  • A GravityExtra license key for this add-on.

How the check works

Understanding the steps makes the settings easy to choose.

  1. When a page with an ALTCHA field loads, the widget asks your site for a puzzle. The address is a small REST route of this add-on, and the answer is never cached.
  2. Your site makes the puzzle: a random salt that carries an expiry time, the form number and the highest number to try, then the SHA-256 hash of the salt joined with a secret number, and an HMAC-SHA256 signature of that hash made with a private secret that only your server knows.
  3. The browser tries numbers one after the other until the hash matches. This is the proof of work. It takes a fraction of a second to a few seconds, depending on the complexity you chose, and it happens in background workers, so the page stays smooth.
  4. The widget puts its answer in a hidden field. When the visitor sends the form, Gravity Forms validates the ALTCHA field: your site checks the signature, the hash, the expiry, the form number and the highest number, and then marks the answer as used.
  5. An answer works once. If the same answer arrives again, even a moment later or from another page, it is refused.

Because the signature covers the hash and the hash covers the salt, nobody can change the expiry, the form number or the limit without breaking the signature, and nobody can invent a puzzle without the secret.

Install and activate

  1. Upload and activate the add-on in Plugins, next to Gravity Forms.
  2. Open Forms, then Settings, then ALTCHA and enter your license key in the Gravity Extra License box.
  3. That is all the setup the check needs. A private secret was made when the add-on was activated; there are no site keys or API keys to copy.

Add the field to a form

Open a form in the form editor. In Advanced Fields you will find ALTCHA. Add it and place it where you want the box to appear, usually just above the Send button. A form can have one ALTCHA field; a second one is refused with a message. The field is display-only: it adds nothing to the entry and never shows in notifications or exports.

A Gravity Forms contact form with name, email and message fields and, below them, the ALTCHA box with a ticked checkbox that says Verified
The ALTCHA box in a form, after the browser solved the puzzle in the background.

If the form has several pages, put the field on the last page. The check is made when the form is really sent, never when the visitor moves between pages, and never when the visitor saves the form to continue later.

Field settings

  • Start: when the widget begins to solve. As soon as the page loads (the default) is the quickest for visitors. When the visitor starts filling in the form saves work on pages most people only read. When the visitor sends the form solves while sending, and When the visitor clicks the box waits for a click.
  • Display: Standard shows the box in the form. Floating shows it next to the Send button and only when it is needed. Overlay opens the check over the page when the visitor sends the form. These are the display modes the widget supports.
  • Floating position: automatic, above or below the button.
  • Complexity: light, standard or strong for this field, or the site default.
  • Language: the site default, automatic (the widget follows the page or browser language), or one of 36 languages.
  • Footer and Logo: show or hide the small Protected by ALTCHA line and the logo. The widget licence allows hiding both.
  • Texts: your own words for the checkbox, while solving, when done, on an error and when the puzzle expired. Leave a box empty to keep the text of the chosen language. The field also has the usual label, description, custom CSS class and custom error message.

The settings page

Open Forms, then Settings, then ALTCHA.

The ALTCHA settings page in Gravity Forms: complexity, custom maxnumber, challenge lifetime, request limit and entry note
How hard the puzzle is, how long it lives and how often one visitor may ask for it.

How hard the puzzle is

  • Complexity is the number of tries a browser may need, the ALTCHA maxnumber. Light is up to 50,000 tries, standard up to 250,000 and strong up to 1,000,000. The solving number is always drawn from the upper half of the range, so even the light setting is never trivially small. Harder puzzles cost bots more and cost a visitor a little more time. Standard is a good start.
  • Custom maxnumber replaces the preset for every field that uses the site default. Use any number from 1,000 to 5,000,000.
  • Challenge lifetime is how long a puzzle stays valid, from 1 to 1,440 minutes (20 by default). The widget fetches a new puzzle by itself when its puzzle runs out, so a visitor who leaves a form open for an hour is not refused.
  • Puzzle requests per minute and visitor limits how often one IP address can ask the challenge address for a new puzzle. The default is 120; 0 means no limit. The address is kept for one minute as a hash and is used for nothing else.
  • Entry note can add a note to every entry. The result is always kept in the entry details.

Defaults and texts

The defaults apply to every field that keeps Use the default in the form editor: start, display, floating position, language, footer and logo. The texts section sets your wording for the whole site; a field can override any of them.

Test

Press Run the server and address tests. The server makes a puzzle, solves it, verifies it, uses it once, and then confirms that a second use of the same answer, an answer with a forged signature, an answer signed with another secret and an expired puzzle are all refused. The browser then asks the challenge address the way a visitor does and checks that the answer is a well-formed puzzle and is marked never to be cached. Test the widget runs the real widget in the settings page and sends its answer to the server for a real check.

Statistics

The statistics show how many checks were verified and how many failed, why checks failed (no answer, answer could not be read, not signed by this site, wrong solution, expired, belongs to another form, already used) and the last days. They are a quick look, kept in one setting row; under very heavy parallel traffic a count can be missed. Press Reset the statistics to start again.

Secret

The secret signs every puzzle. It stays on your server and is never shown on any page. Press Make a new secret if you think it leaked, or when you move a site and want a clean start. Puzzles that are open at that moment stop working and the widget restarts them by itself.

What happens with the entry

A saved entry gets two small pieces of data: the result (verified) and the first characters of the challenge id. They show in the Entry box on the entry screen, and the result can be added as a column to the entry list and used as a filter.

The ALTCHA line in the Entry box of a Gravity Forms entry showing that the check was verified with a short challenge id
The entry screen records that the check was verified.

AJAX, multi-page, Save and Continue, caching and several forms

  • AJAX forms: the widget waits for an unfinished check when the form is sent. If the form comes back with another field refused, the answer is given back and the visitor can fix the field and send again.
  • Multi-page forms: the check is made on the final send. Moving between pages does not use up the answer. Put the field on the last page.
  • Save and Continue: saving needs no check. The resume link opens the form with a fresh widget.
  • Page caching: the page contains only the address of the challenge route, never a puzzle. The browser fetches the puzzle when the page loads, and the route sends headers that forbid caching. A cached page therefore works, and every visitor gets their own puzzle. If your host or CDN caches REST requests, exclude the route that ends in gravityextra-altcha/v1/challenge.
  • Several forms on one page: every form gets its own widget and its own puzzle, tied to its own form number. An answer made for one form is refused on another.

Privacy and GDPR

  • The puzzle is made and verified on your own server. A page with the field makes no request to any other host.
  • The add-on and the widget set no cookies and use no local storage or session storage.
  • No personal data is collected, and no IP address is stored with the answer. The only use of the IP address is the optional one-minute request limit, kept as a hash.
  • The widget script is bundled with the add-on and served from your own site.
  • ALTCHA does not try to tell people from bots by who they are. It makes each submission cost work. That is why it needs no consent banner, and why it works best next to the other protections you already use, such as a honeypot or rate limits.

Accessibility

The box is a real checkbox with a label, it announces its state (verifying, verified, error) through a live region, and it can be started with the keyboard. There is no picture puzzle and nothing to hear and retype. The widget’s authors state that it meets WCAG 2.2 level AA; the add-on keeps the markup untouched and adds a message area with the alert role for refusals.

For developers

  • geal_skip_check (filter): return true to skip the check for a submission, for example for trusted API submissions. Without it, a submission with no answer is refused.
  • geal_checked (action): fires after every check with the result, the reason when refused, and the form.
  • geal_load_widget (filter): return false when you load the same widget script yourself.
  • geal_client_ip (filter): the IP address used for the request limit, for sites behind a proxy.

Troubleshooting

  • The box never finishes: check that the site uses HTTPS, that JavaScript is not blocked and that the challenge address answers. The Test section checks the address for you.
  • A strict Content Security Policy: the widget starts its background workers from a blob address, so the policy needs to allow worker-src blob:.
  • Refused with already used: the same answer was sent twice. Reload the page; the widget makes a new one.
  • Refused with expired: the page stayed open longer than the challenge lifetime and the widget could not renew it, for example because the browser tab was asleep. Send the form again.
  • Refused for no answer: the widget did not run, or the form was sent by a script that never loaded the page.

Frequently asked questions

Do I need an account or an API key?

No. The add-on makes and checks the puzzles itself. The only secret is the one made on activation.

Does it work without HTTPS?

No. Browsers only give pages the cryptography the widget needs on HTTPS and on localhost. The add-on tells you in the settings page and the form editor.

Can I use it on forms next to another CAPTCHA?

Yes. The field has its own type and its own hidden input, so it does not touch other fields.

Is there a Sentinel or cloud mode?

Not in version 1.0.0. The add-on is the self-hosted proof-of-work check.

What does it cost visitors?

Standard complexity takes well under a second to a couple of seconds on a normal computer, in the background, while the visitor fills in the form.

The add-on is for Gravity Forms 2.9 and newer and needs your GravityExtra license for updates and for adding new fields.

See the Gravity Forms ALTCHA Spam Protection Premium 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