By rane
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’,‘example.com’); define(‘WP_SITEURL’,‘example.com’); 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!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
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:
https://www.digitalocean.com/docs/droplets/how-to/connect-with-ssh/
If you are using Windows you can follow this guide here:
https://www.digitalocean.com/docs/droplets/how-to/connect-with-ssh/putty/
For Mac and Linux you could follow this one here:
https://www.digitalocean.com/docs/droplets/how-to/connect-with-ssh/openssh/
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:
cd /var/www/
ls -lah
www. Then just cd into that folder:cd www
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
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.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.