Hisham Sadek

Fix Missing Users from Authors Dropdown List

For some unknown reason, Few WordPress users complained about missing authors from author dropdown list while editing a post or quick edit. The only available solution on a WordPress Forums post doesn’t seem to fix the problem and sometimes it doesn’t work at all. Here’s the problem and solution.

Although everything would look fine for each author or editor as nothing goes wrong but only their name is no longer in the author dropdown list while editing a post, this happens because a field in the ‘wp_usermeta’ table is having incorrect value.

the meta_key ‘wp_user_level’ for authors should carry a meta_value of 2, but while checking the field in database it has meta_value of 0. No apparent reason why this happens but here are 2 ways to fix it.

1- Fix Through phpMyAdmin

You can simply fixing it for each user that has the problem by:

  1. Go to wp_usermeta table in your WordPress database.
  2. Click on ‘Search’ on top of the page.
  3. In the search form, you will find ‘user_id’ field, add the user ID that has the problem and click ‘Go’ button.
  4. Few results will appear to you later, Find ‘wp_user_level’ and edit the ‘meta_value’ of it from 0 to 1 (if Contributor) , or from 0 to 2 (if Author), or from 0 to 7 (if Editor), or from 0 to 10 (if Administrator). then click ‘Go’ button.

2- Fix Through update_user_meta Function

WordPress has a function update_user_meta that is used to update user meta information including those that are hidden like ‘wp_user_level’ to do so you can add the following code to your theme functions.php file:

    $user_id = 2; // change 2 to the desired user ID you want to fix
    $level = 1; //change to 1 if Contributor, 2 if Author, 7 if Editor, 10 if Administrator
    update_user_meta($user_id, 'wp_user_level', $level);

After updating the file you will need to just refresh your website to run the code. You should remove the code after the user is fixed or fix other users by changing User ID.