WordPress droplet - locked out of wp-admin page

I have a DigitalOcean droplet for WordPress. I set up my website, but then went into General Settings and changed the Site Address URL and immediately became locked out completely. All I can see is the error 404 message every time I try to reach my admin page. I’ve seen online there are suggestions to update the wp-config file with the following: define(‘WP_HOME’,‘’); define(‘WP_SITEURL’,‘’); However, I do not know how to even access this wp-config. I am very new to all of this, so if anyone has any step-by-step instructions that would really help!


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Accepted Answer

Hello Rane,

Indeed adding the lines in your wp-config is one way to fix that. The other ways is to connect to your database and in your wp_options table to adjust the values for your Site and Home URLs directly.

So in order to edit the wp-config.php file first you need to connect to your server, here’s how to do that:

If you are using Windows you can follow this guide here:

For Mac and Linux you could follow this one here:

Once you’ve connected to your droplet you can browse through your filesystem as normal. Your website files should be at /var/www/ so what you could do is run these commands here:

  • Go in to that directory:
cd /var/www/
  • Then list the content of the directoru:
ls -lah 
  • You should see either the name of your domain or a folder called www. Then just cd into that folder:
cd www
  • Then list the content again:
ls -lah

There you should see all of your Wordpress files, you can use your favorite editor and edit the wp-config.php file:

nano wp-config.php
  • And there just add the WPHOME and the WPSITEURL lines.
  • Clear the cache of your browser and try accessing the site again.

Hope that this helps! Let me know how it goes. Bobby

Hi Bobby! Thanks for the easy to follow steps. I followed all these and now my site is up and looks normal again (before, it looked as though the theme was entirely missing and nothing was displaying properly). However, I’m still not able to access the /wp-admin page. It seems to be redirecting me and gives me a 404 Not Found Error. Do you have any ideas on why I may not be able to access my login? Thanks so much for your time!! I really appreciate it.

I tried to post a reply earlier but it seems to not have gone through. Sorry if this is reposted twice.