Deleting users with the REST API isn’t supported for multisite, as seen in the source code:
// We don't support delete requests in multisite.
if ( is_multisite() ) {
return new WP_Error(
'rest_cannot_delete',
__( 'The user cannot be deleted.' ),
array( 'status' => 501 )
);
}
For GET requests the user ID is checked against is_user_member_of_blog()
for the current site. If the user is a super admin but has not been explicitly added to that site then they will not be returned and you will receive the rest_user_invalid_id
error.
Related Posts:
- Retrieve all users from wordpress database via REST/JSON API
- How can I get users email (and additional data) from the rest API?
- Basic auth WordPress REST API dilemma
- get_userdata by username
- Rest API code to get ID of current user not working: get_current_user_id() gives 0
- WordPress API for search
- Is there a way to identify a user in a custom REST API method? [duplicate]
- How can I authenticate user credentials against a WordPress instance?
- Rest api return all users (even without content) to all users
- No user found when using REST API
- WordPress REST Api: update user
- REST API: wp_get_current_user not working on second call
- User can’t search himself on rest api
- How to verify which WordPress user requested the API in ASP .NET Core?
- Need to use WordPress page as authentication for different service
- Is there a way to call via javascript if a user is logged-in on a static html file?
- change user password REST API
- how to retrieve user via rest api using custom meta and/or email
- Getting user data via ajax
- Get UserInfo from WordPress
- How can I display Only the first Array/Object?
- How to customize user rest api?
- The same session information for peer users on two different WordPress servers
- REST API list_user
- How to update a user with REST API v2 knowing only the username?
- REST_query_vars for users
- Recognize logged WP user in existing REST API
- Can’t retrieve user email address with REST API
- Get multiple roles with get_users
- How to Merge Two Authors Into One?
- Whats the best way to share user data across multiple WordPress websites?
- User-edit role setting distinct from wp_capabilities? [closed]
- Disallowing Users of a Custom Role from Deleting or Adding Administrators?
- What the user_status column?
- Hide Admin Menu for Specific User ID who has administrator Role
- Problem with Hebrew characters in username
- Display edit link if post author is current user
- Change user’s display name programmatically
- Do not allow users to create new posts and pages
- Set user after wp_create_user?
- Sort get_users by custom field
- Get user input from a form
- How to add wordpress username after url?
- User fields that can be edited by administrator?
- Admins can’t edit each other’s posts
- Update user_login to change username
- Multiple authors with different “author roles”
- Exclude subscriber users from user list
- Can’t add users in admin after copying database
- How can I check if a user’s email exists in the database
- Exclude admin from user list
- How to display total number of post done by user, it should display at authors page wordpress [duplicate]
- Displaying different in-page content to cliente/admin
- Can i add password field into my wp registration form?
- User capability for editing their own comments
- Delete User via Frontend
- how to get WordPress admin user table columns name in my plugin
- Allow Contributors to Upload Files
- Create Next and Previous Link to User orderby Last Name
- OAuth 2 and saving the authenticated user
- Spam users registers even when registration is disabled
- How to notify specific users when i’m posting/modifying a new post
- Limitations when adding new users
- Get an array of all users of a custom role type to send an email notification on post update
- Allow users to create post without logging in?
- How to get the count
- WordPress Password security related questions
- How to make Users sort in reverse order by default?
- Assign random (and unique) user meta upon registration
- How to get ID of Edit User page during wp_handle_upload_prefilter, whilst in Media picker?
- Get user first name from custom endpoint
- What is correct way to change user’s email?
- Display the line breaks in user bio without using html
- Get registered user’s country or IP
- Custom capability for a single user
- wp_dropdown_users() to include null value
- Adding more fields to the add user page on dashboard
- Change User Role based on Point System Issue
- Remove users access to dashboard
- Allow users to upload flash videos?
- How can I clone a suscriber profile in wordpress
- Reading additional fields in PMPro
- How to put the ‘assign to new user’ select when you delete a user that has custom post type posts, but no normal posts
- How can I show a button in WordPress but make it unclickable unless logged in?
- How to display extra fields for user
- How to make WordPress ‘editor’ role to list/view/add/edit users only with the role ‘author’?
- How to make custom user profile page public?
- Fetching all users that didn’t post with rest api (current version 2)
- User Role not showing in Users Screen
- Change user URL
- Deleting anonymous wp_users function not working?
- List all users based on array of domains
- User count only for role frontend vendor
- Does WordPress Need BuddyPress to Handle Large Amounts of Users?
- Giving users an editable homepage/business directory
- Store subscription details for users in WordPress
- Disable editing profile for second time
- No one can edit post/pages by Administrator
- Can I provide a user’s user_ID to them and can it also be searchable in a member’s directory
- application password is missing