littlebizzy / slickstack

Lightning-fast WordPress on Nginx
https://slickstack.io
GNU General Public License v3.0
629 stars 112 forks source link

Changing Domain Name: Image URL Still Pointing to Old Domain #143

Closed voidxd closed 2 years ago

voidxd commented 2 years ago

Hi,

I just successfully change the domain name of my website, however I see image URLs point to the old domain.

I'll change them with some find/replace functionality now, but I figured I should bring this to your attention.

jessuppi commented 2 years ago

Hello @voidxd

Yes I believe this is typical for WordPress because they use absolute URLs in the database. So pretty much anytime that you change your domain name (on SlickStack or otherwise) you would need to do a find/replace on the database, and possibly in your theme files too if the theme used absolute URLs in the template files.

We considered making a bash script for this, but it's too ambiguous really with what should be "replaced".

Usually I use the excellent Better Search Replace plugin maintained by Delicious Brains:

https://wordpress.org/plugins/better-search-replace/

voidxd commented 2 years ago

I understand. I'm using the same plugin.

Thank you very much for your help and the quick response!