Contact Form 7 plugin throws 404 on submit in development site

I have a wordpress project I’m currently working on which is already in production. I downloaded a copy using the duplicator plugin which was supposed to migrate it to the new development url.

I get the following error when trying to submit a form from Contact Form 7.

GET http://www.livewebsitedomain.com/wp-json/contact-form-7/v1/contact-forms/1732/refill 404 (Not Found)

POST http://www.livewebsitedomain.com/wp-json/contact-form-7/v1/contact-forms/1732/feedback 404 (Not Found)

I already searched in my project what could be causing the problem and found this in wp-content/themes/vxm/js/library/scripts.js

var wpcf7 = {
apiSettings: {
root: “http://www.livewebsitedomain.com/wp-json/contact-form-7/v1”,
namespace: “contact-form-7/v1”
},
recaptcha: {
messages: {
empty: “Por favor, prueba que no eres un robot.”
}
},
cached: “1”
};

I tried changing appSettings.root to …/localhost/vxm/… (which is the directory where the project is hosted),

var wpcf7 = {
apiSettings: {
root: “http://localhost/vxm/wp-json/contact-form-7/v1”,
namespace: “contact-form-7/v1”
},
recaptcha: {
messages: {
empty: “Por favor, prueba que no eres un robot.”
}
},
cached: “1”
};

but I keep getting the same errors.

GET http://localhost/vxm/wp-json/contact-form-7/v1/contact-forms/1732/refill 404 (Not Found)

POST http://localhost/vxm/wp-json/contact-form-7/v1/contact-forms/1732/feedback 404 (Not Found)

What also I tried already:

Downgrade Contact Form 7 plugin to version 4.7
Add add_filter(‘wpcf7_form_action_url’, ‘wpcf7_custom_form_action_url’); as indicated in https://stackoverflow.com/questions/14177844/how-to-change-form-action-url-for-contact-form-7

How can I make my contact forms work again?

Read more here:: Contact Form 7 plugin throws 404 on submit in development site

Leave a Reply

Your email address will not be published. Required fields are marked *