Archived topic
GenerateBlocks container background image sets absolute URLs
1 reply · Started by Michael on October 22, 2020
Situation:
I'm using three Wordpress installs:
1. a local "dev" site (on https://fmp.web),
2. an online "staging" site (on https://fmp.*mysite*.net),
3. and (soon) an online "live" site.
These sites each have different domains (see brackets above) so I need to make moving code between them fairly straightforward. I've found on other sites that the WPVivid plugin works well, and provides backups too.
Problem:
WPVivid migrates my "dev" site to the "staging" site. Almost everything works, except where I'm using background images with GenerateBlocks containers. These are set with the full URL rather than an absolute path.
(i.e. "//fmp.web/wp-content/uploads/2020/10/image.jpg" instead of "/wp-content/uploads/2020/10/image.jpg"
Is there a way to make GenerateBlocks use relative paths from the root and leave out the domain?
Pain point:
I didn't notice this at first, because the testing I do is from my laptop which is also the localhost server for the "dev" site. So, it happily served up the local dev images onto the staging site...!
Hi there,
This isn't possible, unfortunately.
However, you can regenerate your CSS in Settings > GenerateBlocks once the migration is complete and all of those file URLs should update to match the current URL you have set.
Let me know if that works or not :)