contact_mailContact Form 7apiREST APIadmin_panel_settingspermissionsdescriptioncontact-form-7lock401labelCommonwarningModerate

Contact Form 7: REST API request failed: 401 Unauthorized

The form tries to send data via the WordPress REST API. The request reaches /wp-json/contact-form-7/v1/contact-forms/…/feedback. The server replies with status 401. The response JSON contains code “rest_cannot_access” and a message about authenticated users only.

This response means the REST API is not available for visitors who are not logged in. The API may be blocked by a filter, a security plugin, a firewall rule, or a server configuration. When the API is blocked the AJAX call never reaches Contact Form 7 processing logic.

Because the request never completes, no email is sent and the form shows a generic failure message. Logged‑in users bypass the block because the REST API permits authenticated requests.

Symptoms

[dashicons-warning]
Generic failure message
User sees "Submission failed. Please try again later." after clicking Send.
[dashicons-admin-site]
Console shows 401 error
Network tab displays 401 response for the /wp-json/contact-form-7/... endpoint.
[dashicons-admin-users]
Works for logged‑in users only
Form submits successfully when user is logged into WordPress.

Common Causes

REST API blocked by plugin
Security plugin adds rest_authentication_errors filter that returns 401 for guests.
Server rule denies /wp-json path
ModSecurity, .htaccess or Nginx rule returns 401 for the endpoint.
Missing nonce in request
AJAX payload lacks _wpnonce field, validation fails and returns 401.
Need this fixed right now?

Don't waste your day debugging. Our experts can Fix your issues in under 2 hours.*

Success Rate

100% Guaranteed

Starting from

$35 /hour
99+

Trusted by Business Owners

“I spent 3 days trying to fix the Elementor loading loop. These guys fixed it in 20 minutes. Lifesavers!”

— Sarah J., Web Designer

Related Issues

contact_mail
Contact Form 7: REST API request failed: 503 Service Unavailable
A 503 Service Unavailable response stops Contact Form 7 from sending data...
apiREST APIerror503descriptioncontact-form-7
contact_mail
Contact Form 7: REST API request failed: 429 Too Many Requests

The form tries to send data through the WordPress REST API. The...

apiREST APIerrorerrorsecurityfirewalldescriptioncontact-form-7settingsserver_configuration
contact_mail
Contact Form 7: REST API request failed: 401 Unauthorized

The form tries to send data via the WordPress REST API. The...

apiREST APIadmin_panel_settingspermissionsdescriptioncontact-form-7lock401
contact_mail
Contact Form 7: File upload error: temporary directory missing

The error appears when Contact Form 7 cannot locate a writable temporary...

codePHPcloud_offupload erroradmin_panel_settingspermissionsdescriptiontemporary filedescriptioncontact-form-7
contact_mail
Contact Form 7: Mail (2) sending failed: PHP mail() function disabled

Contact Form 7 reports a failure for Mail (2) when the PHP...

codePHPerrorerrordescriptioncontact-form-7mailMailsettingsserver_configuration
contact_mail
Contact Form 7: Mail (2) sending failed: SSL certificate verification failed

Contact Form 7 reports a failure when trying to send the secondary...

errorerrorlocksslcodecURLdescriptioncontact-form-7