Can't access wordpress site after changing domain

December 27, 2018 975 views
WordPress DNS

Hi,

My one-click Wordpress droplet worked just fine until I changed the domain name :

I built my website using just the IPV4 for a while, then I bought a domain name from Namecheap and followed the instructions Custom DNS on Namecheap + (A,A,NS) on DigitalOcean. I read that it took time for it to work so I waited 24 hours. The next day I go to my wordpress > settings > general and change the url to to the new domain name I bought.

Now I get "This page isn’t working [url] is currently unable to handle this request." in both my domain name and the droplet's IPV4.

I tried to edit wp-config.php

define( 'WP_HOME', 'http://example.com' );
define( 'WP_SITEURL', 'http://example.com' );

but it didn't work, either with my new namecheap domain and even with my IPV4.

I also read that I should change something in phpMyAdmin but I have no idea how to do that.

Please help me fix my problem,
Thanks.

1 Answer

Hey friend,

You may need to make sure that the values actually updated in the wp_options table in the database. I found this guide that can help you do that via command line (as opposed to phpmyadmin, an unnecessary application that others will suggest to you):

https://wpbeaches.com/updating-wordpress-mysql-database-after-moving-to-a-new-url/

I will add, though, that this can be set correctly and still not fix it. Wordpress allows users to install plugins that change anything about how the application functions, anything desired by the plugin developer. This can mean that your site URL is further embedded in configurations that no one can reasonably assume to give advice on.

If it comes down to worst case scenario, perhaps export the XML data from the Wordpress installation, install a fresh copy on a new server, and import the XML while also copying over the wp-content folder. This may be a shortcut.

Jarland

  • Hi,

    Thanks for you answer;
    I followed what the article said, and now I have "Error establishing a database connection" in both the IPV4 url and the .com .
    I found this article but none of the methods works. When I tried the testconnection.php method, it just returns "Could not connect: " without the error that's supposed to appear.

    Am I doing something wrong ?

    Maybe I got the wrong database username and password ? I found them in the wp-config.php file, both of them are 40+ characters long, are these the right ones ?

Have another answer? Share your knowledge.