简体   繁体   中英

404 Error Contact Form 7 ajax form submitting

The contact form does not work, and affects loading after one try. The chrome console shows the error message:

POST http://example.com/wp-json/contact-form-7/v1/contact-forms/50/feedback 404 (Not Found)
send @ jquery.js?ver=1.12.4:4
ajax @ jquery.js?ver=1.12.4:4
wpcf7.submit @ scripts.js?ver=5.0.3:346
(anonymous) @ scripts.js?ver=5.0.3:53
dispatch @ jquery.js?ver=1.12.4:3
r.handle @ jquery.js?ver=1.12.4:3

How to solve this issue? thanks in advance

迁移网站后,我遇到了同样的问题,在wordpress中重新保存了设置->固定链接 ,将其修复。

FINALLY FIXED!!

Since I'm using nginx all the solutions doesn't worked for me.

I finally fixed that error adding the following lines to the nginx.conf (or file wich contains your server config)

location ~ ^/wp-json/ { rewrite ^/wp-json/(.*?)$ /?rest_route=/$1 last; }

I hope it helps to someone

You Error message clearly shows that particular endpoint doesn't exists.

http://example.com/wp-json/contact-form-7/v1/contact-forms/50/feedback

What i remember, the Wordpress json API mappings has base address of

http://example.com/wp-json/wp/v2/

So, try once if your url is working with this base address or not. Change url to

http://example.com/wp-json/wp/v2/contact-form-7/v1/contact-forms/50/feedback

Or just check proper mappings from http://example.com/wp-json .

This is not a Wordpress pre-defined endpoint and is enabled by Third party plugin mainly contact-form-7 . Make sure you have installed this plugin to your wordpress.

PS : Make sure you are using valid authentication method as certain end-points won't work without that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM