最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

admin - Dashboard menu missing

programmeradmin3浏览0评论

I've lost the wp_users and wp_usermeta tables in a wordpress installation. I've recreated them and insert a new admin user. In particular, in wpAA_users (I use the prefix wpAA_), I have now a user admin with ID=1, while in wpAA_usermeta, for user_id=1 I have wp_cabilities set to a:1:{s:13:"administrator";b:1;} and wp_user_level set to 10.

Now, when I log in to the site the top tool bar shows on the left the general wordpress menu, then the name of the user without the Dashboard menu, and on the right again the hello user name menu (here is a link to the site).

I looked at the wpAA_user_role option in the wpAA_options table, that contain a long string, starting with:

a:5:{s:13:"administrator";a:2:{s:4:"name";s:13:"Administrator";s:12:"capabilities";a:71:{s:13:"switch_themes";b:1;s:11:"edit_themes";b:1;s:16:"activate_plugins";b:1;s:12:"edit_plugins";b:1;s:10:"edit_users";...

I do not know if the user that I've created is not really an administrator, or if something else horribly wrong happened.

So my question is: there is some error in the way used to create a new administrator, or at least how can I diagnose the problem?

Note: I have four or five plugins, and use theme Twenty Seventeen.

I've lost the wp_users and wp_usermeta tables in a wordpress installation. I've recreated them and insert a new admin user. In particular, in wpAA_users (I use the prefix wpAA_), I have now a user admin with ID=1, while in wpAA_usermeta, for user_id=1 I have wp_cabilities set to a:1:{s:13:"administrator";b:1;} and wp_user_level set to 10.

Now, when I log in to the site the top tool bar shows on the left the general wordpress menu, then the name of the user without the Dashboard menu, and on the right again the hello user name menu (here is a link to the site).

I looked at the wpAA_user_role option in the wpAA_options table, that contain a long string, starting with:

a:5:{s:13:"administrator";a:2:{s:4:"name";s:13:"Administrator";s:12:"capabilities";a:71:{s:13:"switch_themes";b:1;s:11:"edit_themes";b:1;s:16:"activate_plugins";b:1;s:12:"edit_plugins";b:1;s:10:"edit_users";...

I do not know if the user that I've created is not really an administrator, or if something else horribly wrong happened.

So my question is: there is some error in the way used to create a new administrator, or at least how can I diagnose the problem?

Note: I have four or five plugins, and use theme Twenty Seventeen.

Share Improve this question asked Jan 5, 2020 at 17:39 RenzoRenzo 1135 bronze badges 2
  • Looks OK to me at first glance. You could try using wp cli to make an admin user too? – Rup Commented Jan 5, 2020 at 17:41
  • I've create another admin user directly in the database, but the result is the same. Note that I cannot open a shell on the wp server. – Renzo Commented Jan 5, 2020 at 17:42
Add a comment  | 

1 Answer 1

Reset to default 0

The problem was in the names of the meta keys of the wpAA_users table: instead of using wp_capabilities and wp_user_level I should have used the actual prefix, that is wpAA_capabilities and wpAA_user_level.

With these modifications I can now access the site as administrator.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论