Oh, forgot to include URL. Edited previous post. The form is on the bottom of the page.
-
This reply was modified 4 years, 3 months ago by
Jan Pencik.
@janpencik thanks for reaching out! When I test WP Forms on an AMP page on my test site, I’m not getting the error. Some items to help troubleshoot:
1) Could you check for any validation errors on the page under AMP > Validated URLs?
2) Are you able to temporarily switch to Transitional Mode and attempt the using the form on the non-AMP version of the page to ensure it works there?
Hi Renee, thanks for your reply. No validation errors on those pages. Setting website to Transitional Mode solves the issue, but is not a solution for me. I need to run all pages in standard AMP mode.
@janpencik thanks for the update!
Setting website to Transitional Mode solves the issue, but is not a solution for me.
Yes, this was a troubleshooting step. To confirm: the form works on both the AMP version and non-AMP version in this mode (or just the non-AMP version)?
Do you have any security measures applied on the site either by a plugin or your host (such as ModSecurity)? Something may be interfering with the form request/ response on the site.
Well, I managed to fix the issue. You won’t believe me what was causing the problem π
So first of all I found out that the theme is the problem. I created fresh WP installation and added both plugins there to test it out. Everything was working with default Twenty Twenty-One theme. My custom theme wasn’t.
I tried to copy things from default theme to my theme to figure out if I am not missing any needed feature. I copied every extra feature from functions, header and footer but it was still not working. So I tried opposite approach… I started to delete everything from Twenty Twenty-One theme until I had super bare bones skeleton of basic HTML tags, blank functions.php and the form was still working on default theme. When I copied the same skeleton to my custom theme, it wasn`t working.
And now comes the workaround. I found out that the form is working only if I rename my theme to the same name as one of the default themes has. This includes theme folder + Theme Name and Text Domain in style.css – then it’s working without any issues. I tested both on localhost and testing server for Twenty Nineteen and Twenty Twenty-One and both names were working. On the other side I tried different other names of the theme (one word, two words) to mimic the name of default WP themes and wasn’t successful.
Thanks, Renee, for your help – I think I am fine with this workaround for now π
@janpencik nice troubleshooting and that’s super interesting!
Do you mind sharing the name of your theme (you can provide it through this form if preferred)? Did it have any special characters? It would be interesting to see if we can reproduce this on our side.
Maybe this helps … I observed the same issue and posted a topic one week ago on the wpforms plugin page https://wordpress.org/support/topic/amp-issue-16/
In my case the theme is OceanWP.
@max2k thanks so much for the tip!
I am having this same issue. I am using a Genesis child theme.
I tried activating the bare Genesis Sample theme… got the same error. Also tried activating the Genesis Parent theme… got the same error.
I reached out to Studiopress and they gave me a fix. I’m adding the solution here in case someone else gets the same issue.
You just have to add this to functions.php:
add_filter( 'wpforms_is_amp', '__return_true' );
Studiopress said that the case could be that WP Forms isn’t detecting that Genesis themes are AMP compatible. Adding that filter to functions.php fixes it.
-
This reply was modified 4 years, 2 months ago by
Hazel Z..
-
This reply was modified 4 years, 2 months ago by
Hazel Z..
@cadencehart thanks for sharing your experience and this solution!