Skip to content

Instantly share code, notes, and snippets.

@sander1
Created February 17, 2017 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sander1/e7bd6d5c1445667fbba8991d44cf9f0e to your computer and use it in GitHub Desktop.
Save sander1/e7bd6d5c1445667fbba8991d44cf9f0e to your computer and use it in GitHub Desktop.
WordPress: Disable JSON REST API
add_filter('json_enabled', '__return_false');
add_filter('json_jsonp_enabled', '__return_false');
remove_action('wp_head', 'rest_output_link_wp_head', 10);
remove_action('template_redirect', 'rest_output_link_header', 11, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment