WordPress site and WP admin not reachable.

Posted April 28, 2020 2.3k views

I have setup a Digital Ocean droplet with Wordpress (Ubuntu WordPress on 18.04). I configured the WordPress using SSH and also configured Letsencrypt certificates using Certbot while doing so. I also configured my wp admin username and password.

I also changed the name servers at my Domain name provider and pointed to Digital Ocean name servers where I added A record and also A record for www subdomain. If I ping my domain name it is pinging to right IP and also when I check using it shows that it is configured correctly.

I could easily access the mydomain/wp-admin and login. I changed the theme and made some layput changes. Then in Settings>General I changed the URLs to for site and wp/admin.

Now when I try to reach the site or wp-admin through web browser, I just get an error of This site can’t be reached refused to connect.

I added following to the wp-config file and restarted apache but still getting same error.

define ('WP_HOME','');
define ('WP_SITEURL','');

note: wherever I have mentioned MYDOMAIN in question, I have used actual domain in settings and files.

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.

Submit an Answer
3 answers

Hello, @paragatipnis

Could you please confirm if the only change you’ve made is basically to switch from http to https in the Settings –> General tab in the WordPress admin panel?

I assume that with the WP_SITEURL and WP_HOME you want to revert those changes. You can also change this from the database if you have access.

You can access the MySQL console and use the following commands:

First locate both entries in the database:

select * from wp_options where option_name='siteurl';

The output should be:

| option_id | option_name | option_value            | autoload |
|         1 | siteurl     | | yes      |
1 row in set (0.00 sec)

To view the home value use this:

select * from wp_options where option_name='home';

The output should be:

| option_id | option_name | option_value            | autoload |
|         2 | home        | | yes      |
1 row in set (0.00 sec)

Then in order to change these you can execute:

update wp_options set option_value='' where option_name='home';

If everything is okay you should see the following output:

Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

To update the siteurl use this:

update wp_options set option_value='' where option_name='siteurl';

This should revert the changes for you.

You can also check why is this not working. To see if Apache is accepting connections on port 443 run:

netstat -plunta | grep 443

If you do not receive any output then it means Apache is not configured to accept connections on port 443 and hence you’re getting the error.

Let me know how it goes.


  • Hi,

    I do not want to revert to http. I want my site to run on https hence I have made those settings in wp-config file.

    I have applied a firewall and opened the port 443 for outgoing connections to all IPs.

    I reinstalled SSL certificate using sudo certbot --apache -d

    Then I checked using wget and got the index.html file in response on console.

    But when I try to access site or wp-admin using https URL, I get “This site can’t be reached” error in return.



  • this is great, made the same beginner mistake and locked myself out too.
    in both commands i needed to add the database reference

    update wordoress.wp_options set option_value='' where option_name='siteurl';

well, i might be able to help. You want to run your website in https, i understand, but let SSL do that. when u enable let’s encrypt ssl, it asks you if you would like to redirect all traffic etc etc to https. it will do that.

but keep your site’s url/wordpress url as http. you will still get https anyways.

coming to problem at hand, if you are not able to do it via wp-admin, i suggest go to your current theme in wp-includes or something i think and then open your theme through ftp and download functions.php , there you add those 2 string values and upload it back and see if you get access. if you do, make sure you remove the strings via ftp again from functions.php .. let me know how it works out. this has happened to me several times.

  • Hello,

    Thanks for sharing this information. Would you mind also providing the exact string values that you are referring to?


Just in case. I had a similar issue, although with a LEMP configuration. I had my Letsencrypt certificates configured with no errors, I fixed all domain names wherever I could find them in the DB and php files. My ufw settings were all fine. The DNS records were all active. I reloaded ufw and Nginx. Still, nothing worked and I had this ‘Site can’t be reached’ response from both Chrome and Mozilla. In the end I simply tried to open the site using its new domain in an incognito mode and it worked. I suppose if I used cURL to check out the URL, it would have become clear sooner and I wouldn’t have spent hours trying to figure out what was going on. So, the only problem in my case was that the browsers saved an obsolete way of accessing the site (most likely in their cookies, site settings or some other behind the scene locations) and just didn’t access the site in a proper way, although the site was up and running. Hope it helps somebody.