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
- Log in to your WordPress dashboard.
- Click on Users in the left-hand menu.
- Click on Add New at the top of the page.
- 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.
- Click Add New User to create the new author.
Method 2: Using the WordPress Users API
- Log in to your WordPress dashboard.
- Click on Appearance in the left-hand menu.
- Click on Editor.
- In the editor, navigate to the
wp-users.php
file (usually located in thewp-content/themes/your-theme
directory). - 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; } ?>
- Save the changes to the file.
- Go to the WordPress dashboard and navigate to Users.
- Click on Add New and fill in the required information for the new author.
- In the Role dropdown menu, select Author.
- Click Add New User to create the new author.
Method 3: Using a Plugin
- Install and activate a plugin like User Role Editor or Role Manager.
- Go to the plugin's settings page and click on Add New User.
- 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.
- 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.