Question

How can I regain Admin access - appears to have lost all users with Admin rights

Posted March 24, 2020 334 views
WordPress

We have a Wordpress site that was set up by Creative Suburbs, an engagement company that has since gone out of business.

Having some experience in using Wordpress, I have been making some updates but when trying to change menus, cannot access anything. Checked with the now owner of the site from Melbourne Water and we only have one Profile set up which is not a Super User or Admin, so cannot make any of the required changes to Menus etc.

Is this something that you can assist with?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hi @nino1256267,

There are a lot of way to change your user from User to Administrator. I’ll go for using WP-CLI. WP-CLI is the command-line interface for WordPress. You can update plugins, configure multisite installations and much more, without using a web browser directly in the terminal.

  • Install WP-CLI

The WP-CLI is available as .phar (PHP Archive) file. You can download this archive file using Wget or Curl command. I’ll be using wget

ssh root@YourDropletIP

As soon as you are in, execute the following commands

wget https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

After the file has been downloaded, make it executable

chmod u+x wp-cli.phar

Move the file to be an executable accessible on the whole system

sudo mv wp-cli.phar /usr/local/bin/wp

Now you have wp-cli install. *Now to the fun and useful stuff *. Go to your DocumentRoot

cd /path/to/your/website

where /path/to/your/website is the actual directory your website is at. As soon as you are there, execute the following command

wp user update USERNAME --role=Administrator

Please remember to change ‘USERNAME’ with the actual user you wish to set as an Administrator.

That’s it, you have now made your user an administrator. For the changes to take effect, logout and login to the said user.

Regards,
KDSys

  • Thanks for the solution, but unfortunately I cannot download or Install WP-CLI as it is blocked by my work server.

    Also, my capability might be less than required.

    Where do I execute the info in the grey boxes such as the

    ssh root@YourDropletIP etc

    Is this in Command Prompt?

    Sorry for the dumb questions but while I am okay at using the back-end technical stuff is my failing!

    Also,

    I am assuming that I change the root@YourDropletIP to the IP of my droplet so it will be root@178.128.125.14.

    Is this correct?

    I really appreciate any further advice or an easier way to regain Admin. Thanks

    • Hi @nino1256267,

      Don’t worry about asking any questions even if you think they sound dumb, they are not.

      Let’s confirm a couple of things, then I’ll get to the WP-CLI part. Yes, you’ll need to execute the grey boxes in your Command Prompt/Terminal. If you are on Windows, You might need to use Putty to connect to your droplet via a Terminal.

      If you are unsure how to do so, you can check the following tutorial : https://www.digitalocean.com/docs/droplets/how-to/connect-with-ssh/putty/

      Now, once you are in, we can go ahead with the WP-CLI commands. WP-Cli should be accessible via your droplet, meaning that you should be able to install it on the droplet and use it there. It’s not tied to the network your work server.

      One other thing WP-CLI is a tool used by WordPress itself.

      Regards,
      KDSys

      • Thanks again.
        I have tried a couple of things on my home computer but still cannot get in to run WP-CLI.

        Can another person do this for me? If so, what will I need to supply to them to enable this?

        regards

Submit an Answer