Question

My IP address redirects automatically to wordpress doman name

I have a problem which I have not managed to find by searching. I set up my wordpress website and restored it using a backup from plugin updraft plus. I restored the old database, and now I cannot access my website. The issue is ‘The page isn’t redirecting properly’. I have tried to access it via my droplet IP address, but this keeps redirecting to the web address and the loop continues. Is there a way I can access my wordpress installation by using the IP address and prevent the redirects? I have also tried adding /wp-admin and /wp-admin.php to the end of the urls, but have had no luck. Thanks


Submit an answer

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!

Sign In or Sign Up to Answer

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.

FYI, @unixynet is correct. You can change this with the following MySQL queries:

UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');

Ofcourse, change the “www.newurl” to the IP you would like to use.

Hi

Connect to the DB using phpmyadmin or via mysql CLI and change these two rows in table wp_options:

select * from wp_options where option_name in ('siteurl','home');

+-----------+-------------+-----------------------+----------+
| option_id | option_name | option_value          | autoload |
+-----------+-------------+-----------------------+----------+
|        37 | home        | https://cachoid.com/blog | yes      |
|         1 | siteurl     | http://cachoid.com/blog | yes      |
+-----------+-------------+-----------------------+----------+

Replace the domain name with your IP and that should do it.

Cheers