Hi Pete!
One way to reduce spam is to use a “honeypot” field. This works by adding a field (e.g. a checkbox) which is hidden by CSS. Most spam bots tend to simply fill all fields it comes across which means it will also fill the honeypot field which is hidden to regular users.
With Advanced Forms you could use the af/form/hidden_fields
(documentation) action to add a checkbox with some phony name, i.e. “_terms_of_service”. Then hook into the af/form/submission
and check the $_POST
variable to see if “_terms_of_service” was checked. If it is simply kill the request using die()
.
Also make sure to hook af/form/submission
with a lower priority than 10, otherwise entries may be created and emails may be sent.
Hope this helps! ??