Overview
WordPress hardcodes your site’s domain name into the database in such things as image, link, and page URLs. This is a problem when you migrate the site to another domain name, or add an SSL certificate because clicking on links redirect back to the old site, or non-secure version.
If you even need to migrate your WordPress site to a different domain name, or add an SSL certificate to it, you must update the URLs in your database in order for your site to function.
If you are familiar with the command line, you can run the following command for the same effect (assuming you saved the old WordPress address).
Using the command line
– First, log into your server via SSH.
– Next, navigate to your WordPress directory.
– In your site’s directory, you can use wp-cli to update the URLs using the following command
wp search-replace http://oldwebsite_domian http://newwebsit_domain --dry-run
The –dry-run call at the end tests the address
If the changes make sense to you, then run the above command again without the ‘dry-run’ call.
For WP-CLI installation, please refer to: https://wp-cli.org/