Support » Plugin: Contact Form 7 » Contact Form 7 /wp-json/ 404 Error

  • Resolved Alpesh

    (@alpesh_p2010)


    I have been using Contact Form 7 from the past few years and never had any issues with it.

    Today, I suddenly decided to test the contact form on my site and after entering the details I have clicked on Submit. It doesn’t do anything, after clicking on Submit ajax loading shows continuously without any error message.

    So, I checked the console and found

    GET https://domain.com/wp-json/contact-form-7/v1/contact-forms/3/feedback/ 404 ()

    I have checked the REST API Settings and everything is good with it, still, the form is unable to submit.

    Please look into this issue and resolve it ASAP.

    • This topic was modified 11 months ago by  Alpesh.
    • This topic was modified 11 months ago by  Alpesh.
Viewing 11 replies - 1 through 11 (of 11 total)
  • Alpesh

    (@alpesh_p2010)

    Found a fix to this problem.

    I checked my .htaccess file and found that I use trailing slash redirect. So, decided to remove the redirect and test out the form. This fixed the issue.

    Modified the trailing slash redirect to exclude URI containing /wp-json and this did the trick. Below is my trailing slash redirect .htaccess code.

    # Add trailing slash to the end of the link
    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !(.*)/$
    RewriteCond %{REQUEST_URI} !^/wp-json
    RewriteCond %{REQUEST_FILENAME} !\.(gif|jpg|png|jpeg|css|js|xml)$ [NC]
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1/ [L,R=301]
    # End Adding trailing slash to the end of the link
    • This reply was modified 11 months ago by  Alpesh.
    john_www

    (@john_www)

    Thanks this fixed my issue!!

    Do you know why this suddenly happened? Did a WP update cause this error?

    cocktail5555

    (@cocktail5555)

    I’m dealing with the same issue all of a sudden. Do I just add that code snippet to my htaccess file?

    john_www

    (@john_www)

    Hi @cocktail5555

    I just added this line to my htaccess:

    RewriteCond %{REQUEST_URI} !^/wp-json

    ZenBen

    (@zenben)

    Thank you @alpesh_p2010

    Another reasons for
    GET /wp-json/contact-form-7/v1/contact-forms/3/fill/ 404
    and
    POST /wp-json/contact-form-7/v1/contact-forms/3/feedback/ 404
    can be >

    1. If you’ve disabled REST API (manually or e.g. with Clearfy)
    2. If you use plugin load filter (https://de.wordpress.org/plugins/plugin-load-filter/) and filter CF7 for pages.

    as I found out.

    Cheers,
    Ben

    • This reply was modified 7 months ago by  ZenBen.
    • This reply was modified 7 months ago by  ZenBen.
    nonchiedercilaparola

    (@nonchiedercilaparola)

    If you use plugin load filter (https://de.wordpress.org/plugins/plugin-load-filter/) and filter CF7 for pages.

    @zenben you are right! i use “Plugin Organizer” to selectivelly load contact form only for contact page and i get some error:

    GET ...jquery.js?ver=1.12.4:4 GET https://www.orsilimolino.it/wp-json/contact-form-7/v1/contact-forms/4/refill

    in my case how can i fix it?

    @nonchiedercilaparola

    Add a plugin filter with the permalink set to https://www.orsilimolino.it/wp-json/contact-form-7/ and select the also affect children checkbox. Then enable Contact Form 7 on the filter.

    For me only rollback to v4.7 worked… htaccess edited like advised above, all plugins disabled/enabled, rest api checked – always 404, no result… still very curious what is the reason…

    I have the same error

    wp-json/contact-form-7/v1/contact-forms/61789/refill 404

    I have tried to add

    RewriteCond %{REQUEST_URI} !^/wp-json

    to htaccess but this doesn’t work.

    Now what?

    gina723

    (@gina723)

    If you are using wpbakery. go to frontend edit. (when i did, i had to guess where i needed to edit as it wasn’t showing up in the frontend) find the the link that isn’t working. click on edit and then link options. locate the page that it is supposed to find and save. that worked for me.

    FINALLY FIXED!!
    Since I’m using nginx all the solutions doesn’t worked for me.

    I finally fixed the 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 will be useful for someone

Viewing 11 replies - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.