Skip to content

Instantly share code, notes, and snippets.

@mitchellkrogza
Last active July 3, 2021 13:36
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 mitchellkrogza/29bab50e493a416b1d93b4d4f537954b to your computer and use it in GitHub Desktop.
Save mitchellkrogza/29bab50e493a416b1d93b4d4f537954b to your computer and use it in GitHub Desktop.
Disable wp-json User Endpoints for Wordpress
// Set this function to only run on front end ONLY (NOT in Admin side it breaks things)
// Use Code Snippets Plugin set to Front end only
add_filter( 'rest_user_query', '__return_null' );
add_filter( 'rest_prepare_user', '__return_null' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment