Question

Site is pointing to IP address, not domain name. SSL error

Total newbie here. Please bear with me. I created a droplet and installed wordpress before attaching a domain name. I have since updated name servers with my registrar and added the domain to the droplet. I used certbot to install SSL for the domain for both direct url and www versions. SSL tests out ok.

The problem I have is when the url is entered (mywebsite.com) it routes to the IP address and a warning pops up stating SSL is for mywebsite.com, not IP address. What misstep did I take?

Also, I have updated general settings in wordpress to show mywebsite.com so that has been covered. After clearing the security warning, the address bar DOES SHOW the URL.

Im sure its simple, but my lack of familiarity is holding me back. Ive been searching for solutions, but no luck yet.


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.

Hi @philcavanagh,

I would assume the IP of your Droplet has been saved in your WordPress’s database. You’ve correctly updated in your general settings to show your website rather than your IP address however it seems like this hasn’t updated your database.

You need to enter your database, I’ll recommend using phpMyAdmin as it’s easier using it rather than your console for this exercise. If you don’t have phpMyAdmin, here is an article on how you can install it:

https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-on-ubuntu-20-04

Once you have it, you can enter your Database via phpMyAdmin and update the Home and Site URLs. This is usually what updating the general settings should do but it’s possible for some reason it didn’t execute properly.

I’ll recommend creating a snapshot of your Droplet first. Better safe than sorry if something doesn’t work as expected along the way.

Hello philcavanagh,

You’ll need to update/change all the references for the IP address in the WordPress database to the domain name, e.g change all references of X.X.X.X to domain.com

If you’re already updated the Home and Site URLs from the WordPress admin panel then you can take the next step and update all the references for the IP address in your database as well.

Note: Please before you proceed take a snapshot of the droplet and also create a backup of the site (both files and database). This will ensure that if something goes wrong you can easily restore your site or droplet if needed

There are a few ways to update the references in your database and it’s totally up to you which one you’ll choose. You can either change them manually if they’re not many or use an automation tool like a plugin or an external app.

One of the external apps that I’ve used and I know for sure that it’s working okay is: https://interconnectit.com/products/search-and-replace-for-wordpress-

You need to upload the script in your public_html folder and access in your browser, then you’ll need to fill in your database details and enter the old name (IP address) and the domain name you want to use. Then you can first use the dry-run option and if there are references that need to be updated you can then run the script and update them.

Also, an alternative way is to use a plugin called “Duplicator” it will update all of the paths and references from the dev domain to the main domain. This is why we usually recommend using a plugin called: Duplicator. The plugin will generate a backup for your website’s files and database. Then when you import the files to the new domain, all of the references for the old domain name will be updated properly with the correct ones.

Another option is to use the All-in-One WP Migration plugin. The plugin will do the replacement for you during import. You do not need to use any additional database search and replace

https://wordpress.org/plugins/all-in-one-wp-migration/

Once this is done you can check the site for any errors as there might be some hardcoded references for the IP address in the files like paths to directories, files and etc.

Hope this helps! Regards,

Alex