I tried to make a copy of my database that has all the //domain.local replaced with //domain.com. However, it seems like I checked a wrong box and I believe that I replaced the domain string in the database that I am working with locally. Now, I can’t access my website anymore. Is there any way I can undo this?
Thank you for any guidance
Any luck with this? I’ve just had the same issue.
Hey @phkundi and @sam_tmm –
The quickest way to do a search and replace on a WordPress database within Local is to use the terminal along with the wp-cli
command.
Here’s how you can go about doing that:
- Right-click on the site and click on “Open Site SSH”
- Use the
wp
command this this:
wp search-replace '<search-string>' '<replace-string>'
So to change from //domain.com
back to //domain.local
the command would look like this:
wp search-replace '//domain.com' '//domain.local'
If you are wanting a more GUI way of doing this, you can look into using the search and replace tool from Interconnectit: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
It’s a great tool, but can sometimes be a little hard to setup. Hope that helps get you pointed in the right direction. Let me know if you have any other questions!