Wordpress website URLs in admin need updating but locked out.

  • Posted November 30, 2014

I changed my WP site url’s in the admin to point to our domain instead of our IP. I do not have phpmyadmin to make the edit to set it back to our IP. How can I get this done? I have a meeting soon, and now I can’t show my client their website. =(


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.

You are correct that an update to your MySQL database is needed to correct this and without phpmyadmin you will need to use the command line mysql client. The steps to update the default address are:

1.) Log into your droplet via ssh and get your root mysql password from the file /root/.my.cnf

cat /root/.my.cnf

2.) Use the following command to connect to your MySQL server from the command line client, entering the MySQL root password when prompted

mysql -uroot -p wordpress

3.) Now you can update your database with the correct url using the following queries, replacint [your ip] with your droplet’s IP address.

update wp_options set option_value = 'http://[your ip]' where option_name = 'siteurl';

update wp_options set option_value = 'http://[your ip]' where option_name = 'home';

Once you have done this your site should again be accessible.