We help IT Professionals succeed at work.
Troubleshooting Question

Wordpress admin user

doctorbill
doctorbill asked
on
43 Views
Last Modified: 2020-11-03
I am having a nightmare time adding a wordpress admin user to the phpmyadmin database interface through my Ionos Plesk panel
I access the phpmyadmin with no problems
I add the user according to these links:
https://kinsta.com/knowledgebase/sorry-you-are-not-allowed-to-access-this-page-error-in-wordpress/
https://kinsta.com/knowledgebase/sorry-you-are-not-allowed-to-access-this-page-error-in-wordpress/
Everything is correct in the database tables
When I try to log into my site as wp-admin I keep getting the error:
Sorry, you are not allowed to access this page
I am getting really fed up with this - Arrrrrgggghhhh...
Any ideas please?
Comment
Watch Question

David FavorFractional CTO
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Tip: Don't do this. Ever.

Can you add a WordPress admin user via phpMyAdmin? Yes!

Should you? No. Especially if you say "I am having a nightmare time adding a wordpress admin user", as this suggests you've missed some oddball intricacy of this process.

Adding a WordPress user (any user, admin or other) via phpMyAdmin creates complications.

Better to do a wp-admin login as an admin user, then add the new user.
Developer
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2013
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
I don't see wordpress toolkit
Where exactly is it

Author

Commented:
David:
I cannot login to wp-admin as an admin
That is the whole point - I need to create an admin user....

David FavorFractional CTO
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Maybe you mean to reset an admin password.

It's impossible to create a WordPress site without at least one admin user.

Well... not impossible... I suppose you could create the site, then delete the admin user with phpMyAdmin.

Provide this information.

1) Mention if there any users at all (wp_users table). Makes no difference if they are admin or other just any user.

2) Mention how the site got into this state, as other problems make exist as a side effect.

3) Mention if you can ssh into the machine, as the easiest way to create a new user is something like...

wp-cli.phar user create $user $email --role=administrator --user_pass=$pass --first_name=$first --last_name=$last

Open in new window


4) If you really must do this, then create a temp user, which will only exist till you can login + use WordPress to create an admin user, as manual user creation almost always fails in subtle ways.

https://www.wpbeginner.com/wp-tutorials/how-to-add-an-admin-user-to-the-wordpress-database-via-mysql/ provides a good set of instructions for creating the wp_users + wp_usermeta entries.

Once you can login, create a user with WordPress, then delete the user from WordPress, then check wp_users + wp_usermeta to ensure all rows are actually deleted + if not, remove them with phpMyAdmin.
David FavorFractional CTO
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
https://wp-cli.org provides latest wp-cli.phar script.

Author

Commented:
David:
I have already done all the steps in the link you sent above
There are already admin users in the database but I don't have their passwords
The site is not in a bad state - it is fully working
All I want to do is to create another user as admin because the existing users are not available to ve contacted at the moment
When I create a user according to the link, all the entries are correct in the database (as I have said above) but it just doesn't work
I get the access error

David FavorFractional CTO
CERTIFIED EXPERT
Distinguished Expert 2019
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
David FavorFractional CTO
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Note: Reading over your initial description, I doubt a password reset will help.

The above MD5() answers this question.

If the access problem persists (almost surely will), then open a new question to debug the site's access problem.

When you open this new question, be sure to provide the site URL, as guessing about what error you might be seeing... well...

Testing is far better than guessing, about what you might be seeing.

Also in your new question, mention what type of site access you have - sftp or ssh.
Scott FellDeveloper
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2013

Commented:
Make sure you have saved back ups from before any of this happened.

I don't think this is a user/password issue and could be a plugin or file permissions issue. The reason I am saying that is you are logging in and getting that error instead of not being able to log in at all.

Sometimes Plesk changes file permissions when it updates. In plesk you can change all the wp-* folders and files to read/write for owner.  Sometimes that will fix the issue.  Review step 5 on the following link for a more detailed description of how to do this https://kinsta.com/knowledgebase/sorry-you-are-not-allowed-to-access-this-page-error-in-wordpress/


Author

Commented:
Thanks guys - I managed to change the PW in the database - I was given a user name of someone who no longer works at the Company
Final questions:
Can you suggest the best plugins for the following:
Menus
Sliders
Translations
I just need one of each - don't mind paying for them if they do the job

Scott FellDeveloper
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2013

Commented:
Usually, those types of things come bundled in your theme if you purchased one.

Your best bet is to look for plug ins on Wordpress.org.  Install them on a test site to play with and see if it fits your needs. When looking for plugins, I look for options that have a lot of users, high ratings and most important recently updated. If the last update was more than a month or two ago, I would start to be suspicious. If it was longer than 3 to 6 months, I would skip.

Author

Commented:
Awesome - thanks guys

Author

Commented:
Thanks all
David FavorFractional CTO
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
You're welcome!
David FavorFractional CTO
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Best to open separate questions for each of these...

Can you suggest the best plugins for the following:
Menus
Sliders
Translations

Open in new window


The way I handle this is only use code from the https://WordPress.org repository, as this code is checked before release to ensure no backdoors.

Many premium plugins contain backdoors, so if you use these, scan them for backdoors before installation.