Deactivate Plugins for REST API
-
Hi, is possible to use the plugin to disable apps loaded with REST API requests?
-
Hi @countrypark
As a default it’s possible, but only with standard WordPress rest API that includes wp-json in the URL
If you need to disable plugins with non-standard rest APIs that call URLs that don’t include wp-json, you need to add this line in wp-config.php before the comment /* That’s all, stop editing! Happy blogging. */:
define( 'EOS_DP_ALLOW_POST',true );In this case, check all the actions that you can do on your website (submitting a form, adding a product to the cart…).
In both cases, you can use the settings Custom URLs => Frontend URLs
In the first case you can add something that looks like */wp-json/wp/v2/sample-parameter*.
For non-standard REST APIs add something that matches your URLs.Let me know if it’s not clear.
Hi, thanks for the info, I will forward this to the app developer.
where would the option for disabling certain plugins for REST API be in the plugin?
To clarify, I don’t want to disable plugins that use REST API, I have an app that connects to the site with REST API and was wondering if it’s possible to disable other apps from slowing down the REST API requests by disabling those apps from the REST APi requests of my app.
Freesoul Deactivate Plugins => Settings => Custom URLs => Frontend URLs
If your app calls for example http://yourdomain.com/wp-json/wp/v2/pages
you go to Custom URLs => Frontend URLs, you add a row with */wp-json/wp/v2/pages*, and disable the plugins that you don’t want they run when the app calls http://yourdomain.com/wp-json/wp/v2/pages
Hi, I’m reffering to this on this article: https://wp-qa.com/wordpress-rest-api-slow-response-time
Overview: So the issue is a limitation of WordPress as of version 4.8. WordPress is designed to load plugins and themes and all of its core every REST API request. Here is the reason for the slow response time.
does your last response apply to this?
Hi @countrypark
yes, it does. The core of WordPress will and the theme still load. You can only disable the plugins.I will close this thread. If you have any issues and still need help don’t hesitate to open it again and reply.
Thank you
The topic ‘Deactivate Plugins for REST API’ is closed to new replies.