I’ve been working on migrating my old html site to WP. The URL of the new dev site is https://davesguitarplanet.com/dgpdev/ . But it’s very slow working on it over the internet, so I wanted to copy it into LBF (which I’ve used before).
I used UpdraftPro to backup this site and downloaded the zip files to my Mac. I made a new site in LBF using these files. It works fine. But, when I click on one of the pages in the site in LBF, it goes to get that page on the internet with, for example, this URL: http://davesguitarplanet.com/dgpdev/070-blackbird/
A strange this is, the page with the link to the above page has a local URL: https://dgplocal9219.local/dgpdev/intermediate-3/
Obviously, I want it to call up all the pages on my Mac and not go out to the page on my host. (In fact, I’d like to disconnect from the internet while I work.) I’m guessing there’s a way to make it do this…or would that be hard to accomplish? Thx.
Hey @snerj –
It’s hard to say what might be causing that issue. The most likely thing is that there are still references to the remote dev site within either the theme or within the content itself.
Looking at the source code for the dev site, I’m seeing that it looks like Elementor is being used. Sometimes page builders can store content in a way that the search and replace functionality of Local doesn’t work.
I would recommend taking a closer look at the content and in particular, the links that are being used and verify that they are all referencing the Local site.
It might also make sense to try various search and replace operations on the database so that the remote, dev URL is updated to use the Local URL.
This plugin is handy for that sort of thing:
But you can also right-click on the site and select “Open Site SSH” to open a terminal. Within the terminal, you can do search and replace jobs by typing:
wp search-replace 'search-string' 'replace-string'
So for your case, it might look something like:
wp search-replace '/davesguitarplanet.com/dgpdev' '/davesguitarplanet.local'
It’s a good idea to take a backup first since you will be working on the database, but that’s the general idea! If searching and replacing doesn’t help, then I think you’re left with updating those urls by hand. Good luck!