Support » Plugin: Disable WP REST API » Blocks Contact Form 7 forms sending
Blocks Contact Form 7 forms sending
As the title says: Blocks Contact Form 7 forms sending after install and activate.
- This topic was modified 3 months, 2 weeks ago by Hendrik57.
Plugin Author Jeff Starr
Try this.Plugin Author Jeff Starr
To anyone else reading, here’s how it works.
This plugin disables the WP Rest API for non-logged users. So plugins that require REST API for non-logged users are not going to work. Like a car won’t run without an engine, or a bird can’t fly without wings. For example, as @hendrik57 points out, Contact Form 7 plugin relies on REST API for non-logged users, so naturally it’s not going to work when you disable REST API via this plugin. Why give the plugin a one-star rating for doing its job perfectly. Looking at you, @hendrik57.
What about adding custom code to the plugin, so that Contact Form 7 will work? The stated mission of this plugin is to disable the REST API in the lightest, fastest way possible. So yeah, I could add some more code all special just so CF7 will work. But that sets a precedent. Users of other REST-requiring plugins will request similar special treatment for their chosen plugin(s), just like CF7. So the once-simple disable-REST plugin gets more complex, more code, more management, etc. And guess what, there are thousands of plugins that make use of the REST API. Should I break my back trying to support them all?
No I shouldn’t. Because there are other disable-REST plugins that provide more functionality and can be configured to allow for Contact Form 7 or any other plugins that may require REST API. Alternately, there are many plugins that do not require the REST API for anything.
So to sum up, you have the following options when it comes to the WP REST API:
- Use this plugin, Disable WP REST API to disable REST for everyone who is not logged in to WordPress
- Use a more advanced plugin such as Disable REST API to configure REST access to allow for plugins like Contact Form 7
- Or simply don’t disable REST API, so all REST-dependent plugins like Contact Form 7 will work normally
Also should mention the CF7 REST addon. As explained there in the post, the CF7 addon enables Contact Form 7 to work even when REST API is disabled. Unfortunately, the addon doesn’t work completely with newer versions of CF7. Visitors can still send messages, but the resulting success and error messages are not displayed on the page. Presumably because there is some other use of REST API happening there. I am looking into it, but so far it seems like something that will need worked out on the CF7 side of things. I will sticky post in the plugin forum if any solution is possible.Plugin Author Jeff Starr
Update! Figured out a solid solution for enabling Contact Form 7 to work with Disable WP REST API. Simply add your contact-form REST URIs to the custom code and done. Linked tutorial contains all the details.Thread Starter Hendrik57
Your comment is correct on me.
In fact we did enable Contactform on all sites for non-logged-in users in the plugin.
It should be fine when the plugin checks these kind of dependencies and warns or advise about settings, or even do those minimal auto settings for active plugins.
And this is not negative about WP REST API, but it is a warning that some plugins like ContactForm7 depend on open calls to the database.Plugin Author Jeff Starr
Yes exactly. It’s up to the plugin user to understand how it works, what is does, and how it may affect functionality of other plugins, etc. I’m always here to help with any questions. Thank you, @hendrik57.
- You must be logged in to reply to this review.