Wednesday 23 March 2016

WordPress, Contact Form 7 and recpatcha causing "failed to send your message" when submitting forms

I've recently started using the recaptcha plugin for contact form 7 in my WordPress sites. When I made a recent site live, none of the forms were sending.

Upon investigation, the issue was related to having the recaptcha present on the form as if I removed it they would send straight away.

When I originally added it I remember setting up the API key and yet it still wasn't working. On closer examination, the secret key was wrong and resetting the API keys solved the issue.

The reason the key was wrong is because when you highlight the secret key on Googles API page and copy and paste it, it doesn't just select the key - it takes the text description of it too! So you end up pasting the key with extra text at the end which I never noticed when originally adding it.

Bottom line - if the form won't submit and you've got recaptcha running I would double check your API keys as you may have made the same mistake as me :)

One more thing to remember (although not directly related to the above) is that the codes for the contact form objects, such as  [your-name] are case sensitive! So [your-name] is not the same as [Your-Name]


No comments:

Post a Comment