Go to your WordPress backend. https://www.yoursiteurl.com/wp-admin
Log in with your Administrator login.
Go to Users on the left-hand panel.
Search for the user you’d like to remove from the site.
Select Edit under their name.
Scroll halfway down the page to the Role setting.
Instead of deleting the user permanently, simply change the role to “No role for this site”. This will prevent the user from being able to log in while keeping their name on the posts.
Be sure to scroll down to the bottom and select Update User to save your changes.
*If you still choose to delete the user, we are not able to retrieve the user’s information anymore and all of their content will have no author attached.