On one of my sites, my Divi contact form worked great on desktop but someone told me it didn’t work on mobile. Sure enough, they were right! On my iPhone, I got this message after submitting the form:
“Please refresh the page and try again.”
In French, the error is “Veuillez actualiser la page et réessayer”.
The form didn’t submit, even after refreshing (and even if it had, that would be an unacceptable workaround!)
This was embarrassing, as this was my web developer portfolio site!!
If you’re using the Divi Contact form, here’s how to fix the problem.
Experimentation
I couldn’t find the solution online, but after some experimenting, I found a few interesting things. If I disabled my spam blocker, WP Spamshield, the form would work on mobile.
So, I switched to Akisment, but it had the same problem.
Well, I couldn’t have a live site without spam protection, so I checked one other thing: I deactivated WP Fastest Cache, and the form started working again.
The Solution: Disable Caching
So it seems like the combination of anti-spam and caching breaks the Divi Contact Form module on mobile.
This was not a high-volume site, so I just deactivated WP Fastest Cache and left Akisment installed.
If you need a contact form to work with WP Fastest Cache, try the Contact Form 7 plugin. I verified that works on mobile with WP Fastest Cache.
I have since then switched to Siteground hosting, and I’ve confirmed that the Divi contact form does work with their caching fine.
One Solution If You Want To Keep Caching
I have switched hosts again, this time to Gridpane hosting on Vultr. Again, with the Redis object cache on, my Divi contact form didn’t work on desktop or mobile. Switch cache off, it works fine.
The solution is to reduce the Redis Cache Expiry time to something less than 24 hours so that the WP nonce gets refreshed. I set it to 8 hours (28800 seconds). Note, Gridpane has now added this setting to their control panel, so no need for command line to do it.
After doing that I had to reload nginx. Now, my Divi contact forms work with the Redis Cache enabled on Gridpane!
A similar strategy might work on other hosts. Many thanks to Jordan T. for coming up with this fix!
Hope this was helpful! – Brian
I am a freelance web developer and consultant based in Santa Monica, CA. I’ve been designing websites using WordPress and from scratch using HTML, CSS, PHP, and JavaScript since 2010. I create websites and web applications for businesses, nonprofits, and other organizations. I have a degree in Electrical Engineering (BSEE) from California Institute of Technology and a degree in Engineering Management (MSEM) from Stanford University.
Discover more from Web Developer Tips and Tricks
Subscribe to get the latest posts sent to your email.
Please Leave a Question or Comment
Thanks Brian for your help. In french, the error is “Veuillez actualiser la page et réessayer”
Thank you Greg! I added that to the article.
Best,
Brian
Brian, I think with GridPane you simply need to set the cache time to below 12 hours and this will resolve the issue.
Jordan,
Thanks again for your help on this. I’ve updated my article to mention your solution to fix the Divi Contact Form on Gridpane.
Best,
Brian
thanks brian! this was my exact problem. if it helps anyone else, deactivating WP Fastest Cache and then reactivating worked again.
Hi Emma,
Thanks for sharing!
Best,
Brian
Hi Emma,
One warning – please wait 24 hours and test again. Deactivating and reactivating WP Fastest Cache might have cleared the cache and refreshed the WP nonce, allowing it to work temporarily.
Best,
Brian
Thank you Brian! I had the same problem…
Hi Janos,
Glad it helped! Thanks for sharing!
Best,
Brian
Hello guys!
I’m having issues to receive emails from the divi contact form
I’ve reserched on google and follow up all the instructions in this post
https://wp.rocks/fix-contact-form-bug-divi/
However i an fix it?
Do you have any sugestions ?
You saved my day.. Thank you!
Hi Jan,
So glad this helped! Thanks for sharing!
Best,
Brian
Thanks for the tip! I was able to resolve the error based on your post by excluding the page with the contact form from my wp-fastest cache settings. Under the exclude tab, exclude pages, ‘add new rule’ and type the URI for the page with your form.
Hi David,
Thanks for sharing! Glad it worked for you!
Best,
Brian