program using: ubuntu 18.04
Problem: so i have two local wordpress sites running on my localhost, say site1 and site2
I have migrated all of the databases from site1 to site2. Now when I click on one of the link that's in site2, it's changing the URl to site1/pageIwantTovisit. I don't want that. I want it so that, if I'm on site2, then all the links should refer to site2/pageIwantToVisit.
I'm using phpmyadmin. I've changed the home and siteURL to site2 but the links don't change unless i manually hardcode all the link which will take forever.
The link in site2 should go from about page to blog page. Thank you.
program using: ubuntu 18.04
Problem: so i have two local wordpress sites running on my localhost, say site1 and site2
I have migrated all of the databases from site1 to site2. Now when I click on one of the link that's in site2, it's changing the URl to site1/pageIwantTovisit. I don't want that. I want it so that, if I'm on site2, then all the links should refer to site2/pageIwantToVisit.
I'm using phpmyadmin. I've changed the home and siteURL to site2 but the links don't change unless i manually hardcode all the link which will take forever.
The link in site2 should go from about page to blog page. Thank you.
When editing content in the content editor WordPress hardcodes the current URL that is being used to access the WordPress admin. This is usually found in link href
and image src
. There are several plugins or tools (like wp-cli
) that can assist you in finding and replacing the url between environments.
You will likely want to your search to look something like:
Old
//site1
New
//site2
NO TRAILING SLASH in the search! Don't use the protocol if you are not trying to switch/normalize urls from http
to https
, same goes for www
domain variants.
If you access the site at several different domains during the development cycle you may want to look into tools like the WordPress plugin WP Migrate DB Pro
that find and replace while migrating between environments or manually on the current environment.