Let’s say you’ve decided to go live with your test site. In addition to that you’ve upgraded your Bolt, added your custom domain and pointed it to us. Now when you try to use the custom domain you’re still being redirected to our internal domain. In most cases this is because you haven’t updated your site to recognise the usage of your custom domain.
This is an easy fix though, and the quickest way to do it is to use WP-CLI which is installed on all Bolts. Some knowledge of SSH and how to log into the server is necessary. Check out our articles on the subject if you don’t know how.
The WP-CLI command we’re going to use is called seach-replace and the syntax looks like this:
wp search-replace [OLD_URL] [NEW_URL] --all-tables
Here the command will search all tables within your database for strings that match [OLD_URL] and replace them all with the new string, [NEW_URL]. The brackets is there to show where the strings go, remove them when you actually do the search-replace. In addition also add the
--all-tables parameter at the end as this instructs the command to affect all tables in your database.
Check out the official WP-CLI documentation.
Example of the command in use
WP-CLI man pages
Too look at what else WP-CLI can do for you, you can run the command
wp and the man pages should pop up.
If you’re using Elementor
Should you use the Elementor plugin as your page builder it is important to rather use their search-replace function. Pure WP-CLI search-replacing won’t be able to match all instances in your database where Elementor saves your URLs. So the best way to catch all instances you want to replace is to use the command:
wp elementor replace_urls [OLD-URL] [NEW-URL]
For more information on Elementor relevant terminal commands, check out their official help page.
Though this only covers one instance with one plugin, you might very well use other plugins which hides similar things. We recommend you to do some research on the plugins you have installed to see if they have similar features that might be better to use.
And as always, should you have any additional questions please don’t hesitate to contact our support chat at servebolt.com!
Give us your feedback on this article
Want to speed up your site, easily?
Set up your site on Servebolt, free of charge for 60 days, and see for yourself how fast it can be on our extremely fast hosting.
A faster site converts better, ranks better on Google, and is better for the climate.