Completely disable WordPress REST API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'rest_enabled', '_return_false' ); | |
add_filter( 'rest_jsonp_enabled', '_return_false' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The rest_enabled filter hook is deprecated and doesn't work anymore since WP 4.7. So WP rest API will still be accessible with this gist in place.
Use the hook rest_authentication_errors to manage access to the api.