How to add new user in wordpress

To add a new user in WordPress, you can follow these steps:

Method 1: Using the WordPress Dashboard

  1. Log in to your WordPress dashboard by going to yourwebsite.com/wp-admin.
  2. Click on the "Users" tab in the left-hand menu.
  3. Click on the "Add New" button at the top of the page.
  4. Fill in the required information for the new user, including:
    • Username: a unique username for the new user.
    • Email: the email address for the new user.
    • First Name and Last Name: optional fields for the new user's name.
    • Role: choose the role for the new user from the dropdown menu (e.g. Administrator, Editor, Author, etc.).
    • Password: set a password for the new user.
  5. Click the "Add New User" button to create the new user.

Method 2: Using the WordPress User Registration Plugin

If you have the WordPress User Registration plugin installed, you can use it to add new users. Here's how:

  1. Log in to your WordPress dashboard.
  2. Click on the "Users" tab in the left-hand menu.
  3. Click on the "Add New" button at the top of the page.
  4. Fill in the required information for the new user, including:
    • Username: a unique username for the new user.
    • Email: the email address for the new user.
    • First Name and Last Name: optional fields for the new user's name.
    • Role: choose the role for the new user from the dropdown menu (e.g. Administrator, Editor, Author, etc.).
    • Password: set a password for the new user.
  5. Click the "Add New User" button to create the new user.

Method 3: Using the WordPress REST API

If you have a custom application or script that needs to interact with your WordPress site, you can use the WordPress REST API to add new users. Here's an example of how to do it using the wp-json endpoint:

  1. Send a POST request to yourwebsite.com/wp-json/wp/v2/users with the following JSON payload:
    {
    "username": "newuser",
    "email": "[email protected]",
    "first_name": "New",
    "last_name": "User",
    "role": "author",
    "password": "newpassword"
    }
  2. Set the Content-Type header of the request to application/json.
  3. Send the request to create the new user.

Note: Make sure to replace yourwebsite.com with your actual WordPress site URL, and newuser, [email protected], New, User, author, and newpassword with the actual values you want to use for the new user.