WordPress domain change
How to change the address of a WordPress site to a new domain or from http to https without losing content.
When a site gets a new address, WordPress has to know it in two places: in the settings and in the content (links and images in the database). Before you start, back up the site and the database: Importing and exporting a database.
- Add the new domain to the account in cPanel (Domains → Domains) and point it to our server: Point your domain.
- Change the address. If you can access the admin: Settings → General, enter the new address in WordPress Address (URL) and Site Address (URL). If you cannot log in, change
siteurlandhomein thewp_optionstable in phpMyAdmin. - Replace the old address in the content. In WP Toolkit open Search & Replace and replace the old address with the new one. Do not use a plain "find and replace" in an SQL export because it can break serialized data.
- Redirect the old domain to the new one with a 301 redirect (Domains → Redirects) to keep visitors and search engine position.
- Check HTTPS on the new domain: SSL certificate and AutoSSL and Forcing HTTPS.
- Clear the cache of the caching plugin and the browser.
If the site shows an error after the change#
- Broken images or styles are usually old addresses: Mixed content.
- Constant redirects to the old domain: check
.htaccessandwp-config.php(WP_HOME,WP_SITEURL).
For a new domain you may also want new email addresses: Create an email address.
Was this article helpful?
Thanks for your feedback! Need help? Open a ticket.
Related articles
Point your domain to ScyHostHow to change nameservers at your registrar so your domain opens your site on ScyHost.phpMyAdminBrowse, edit and search database tables through a web interface.Forcing HTTPSHow to automatically redirect all visitors from http:// to https:// using cPanel or the .htaccess file.WP ToolkitThe central tool for managing WordPress installations: updates, backups, cloning and login.
