Here is another code snippet for Gravity Forms that will hopefully be useful for someone. Recently, a client was receiving a particular annoying spam submission on their contact forms. Everyday, they would receive the exact same entry from someone trying to sell a copywriting service. The content was always the same but they used a different IP address every time and would not trigger the honeypot field protection. We looked at Akismet but felt this would be too costly as, surprisingly, there was very little spam otherwise.

In the end, I wrote a very simple hook that simply searches every field in the form for known spam words (eg a certain email address). If any of these words are found, it fills out the honeypot field and lets Gravity Forms do the rest.