How to add new author in wordpress

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

Method 1: Using the WordPress Dashboard

  1. Log in to your WordPress dashboard.
  2. Click on Users in the left-hand menu.
  3. Click on Add New at the top of the page.
  4. Fill in the required information for the new author, including:
    • Username: A unique username for the author.
    • Email: The author's email address.
    • First Name and Last Name: The author's full name.
    • Role: Choose Author from the dropdown menu.
    • Password and Confirm Password: Set a password for the author.
  5. Click Add New User to create the new author.

Method 2: Using the WordPress Users API

  1. Log in to your WordPress dashboard.
  2. Click on Appearance in the left-hand menu.
  3. Click on Editor.
  4. In the editor, navigate to the wp-users.php file (usually located in the wp-content/themes/your-theme directory).
  5. Add the following code to the file:
    <?php
    function add_new_author($username, $email, $first_name, $last_name) {
     $user_id = wp_insert_user(array(
         'user_login' => $username,
         'user_email' => $email,
         'first_name' => $first_name,
         'last_name' => $last_name,
         'role' => 'author'
     ));
     return $user_id;
    }
    ?>
  6. Save the changes to the file.
  7. Go to the WordPress dashboard and navigate to Users.
  8. Click on Add New and fill in the required information for the new author.
  9. In the Role dropdown menu, select Author.
  10. Click Add New User to create the new author.

Method 3: Using a Plugin

  1. Install and activate a plugin like User Role Editor or Role Manager.
  2. Go to the plugin's settings page and click on Add New User.
  3. Fill in the required information for the new author, including:
    • Username: A unique username for the author.
    • Email: The author's email address.
    • First Name and Last Name: The author's full name.
    • Role: Choose Author from the dropdown menu.
  4. Click Add New User to create the new author.

After creating the new author, you can assign them to a specific role, such as Author, Editor, or Administrator, depending on your needs.