permalinks - why does my url not update after migration?

admin2025-06-02  1

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.

Share Improve this question edited Mar 6, 2019 at 18:53 fuxia 107k39 gold badges255 silver badges461 bronze badges asked Mar 6, 2019 at 18:40 Devon KaryoDevon Karyo 112 bronze badges 3
  • Use this script to replace ALL urls in your database. – Qaisar Feroz Commented Mar 6, 2019 at 18:46
  • hey, I'm already using search and replace plugin from wordpress. – Devon Karyo Commented Mar 6, 2019 at 18:53
  • Clear browser cache – Qaisar Feroz Commented Mar 6, 2019 at 18:56
Add a comment  | 

1 Answer 1

Reset to default 1

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.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748835745a314122.html

最新回复(0)