Scenario / Problem
I am using Contact Form 7 plugin on my WordPress blog.
The form is displayed properly. But, when I submit the form, the spinning arrow is displayed forever and no success or error message is displayed. However, the form is working. It is submitted and I get the message in my inbox.
The main problem is:
– success or error message is not displayed
– spinning arrows displays forever
– this shows, as if the form is not working
Quick Fix / Solution
I googled and found the following suggestions/solutions:-
1. The official website of contact form 7 says that this may occur due to a conflict between plugins/theme. It suggests to deactivate all other plugins and switch to the default theme.
Their solution might be a good and reliable one but it takes lot of time to figure out which plugin or theme did create such problem. I did not follow their suggestion.
2. The other solution I found was changing a configuration setting in the contact form plugin’s file.
Open file:
/wp-content/plugins/contact-form-7/wp-contact-form-7.phpChange this:
define( ‘WPCF7_LOAD_JS’, true);To this:
define( ‘WPCF7_LOAD_JS’, false );
This one is a quick fix. But, when you apply this fix, your form will not be submitted through Ajax. Instead, your contact form page will be reloaded when you submit the form. I did try this solution and it worked for me. However, I did not use this because I want my contact form to be submitted through Ajax.
3. This final solution was what I wanted. This simple trick will let your contact form work as before.
Add file upload field in your contact form. You can go to the contact form plugin settings in admin and add a file upload field in your contact form. If you don’t want to display the file upload field in your form then you can simply make it hidden. Like this:-
Here, file-upload is the name of the file upload field.
Hope this helps. Thanks.