Disable WordPress Json API endpoint for for security purpose
// Disable WP JSON API
add_filter( 'rest_authentication_errors', function( $result ) {
if ( ! empty( $result ) ) {
return $result;
}
if ( ! is_user_logged_in() ) {
return new WP_Error( 'rest_not_logged_in', 'You are not authenticated.', array( 'status' => 401 ) );
}
return $result;
});