Image URL's not updating when moved from DEV to LIVE

I’m currently using WordPress+ DIVI + Pantheon. When moving the site from dev to live, I ran into an issue I’ve never seen with any other host platform before. DEV URL=“dev-companyname-corp.pantheonsite.io” LIVE URL=“companyname.net”. The URL’s in the web address are updating properly but when I review the source code of the individual pages MOST (strangely not all) of the image URL’s are still showing the DEV URL. We have a tedious workaround we can implement to fix it, but I’m hoping there’s a faster solution or even a setting/option that can be enabled to make sure that it updates to show the LIVE URL after being pushed from DEV. Anyone experienced this, or have any advice on how to fix it? Thanks in advance.

I tend to use Better Search Replace:

I’ve noticed that most things tend to work fine, but there’s a few links/images in the actual content/body that don’t update correctly.
The BSR plugin works a treat and is pretty quick.
Just note, you need to add a little tweak to get BSR working nicely on Pantheon - https://pantheon.io/docs/plugins-known-issues#better-search-and-replace for more info.

1 Like

Thanks for weighing in here, @niknewys! @davidj88, please let us know if you still need support on this!

1 Like

Thanks so much for your help and for recommending this plugin! Just wanted to let you and anyone else who stumbles across this topic know that I was actually able to get this to work with only an install in the DEV environment, so no PHP edits required.

WordPress seems to “assume” the domain of files with folder paths it recognizes. So, I used the Better Search and Replace Plugin installed in the dev environment and instructed the BSR plugin to search for “https://dev-companyname-corp.pantheonsite.io/wp-content/uploads/” and replace it with just “/wp-content/uploads/”. Glad to say that after doing a dry run test (bsr pro) and pushing through all the environments, the URLs updated perfectly across all! Thanks again.