- This topic has 20 replies, 8 voices, and was last updated 1 year, 11 months ago by Ying.
-
AuthorPosts
-
November 16, 2020 at 8:26 am #1533637Dominik
Hi,
the URLs from images, embedded as background-images in a GenerateBlocks container, won’t update after a domain change. I encountered this problem twice with two different sites running on GeneratePress & GenerateBlocks. It occurs when I am transferring a website or just change the domain.
I also changed all database entries with plugins like “Better Search Replace”. All other pictures and the rest of the site worked fine. Only the background images are stuck to the old URL.
A workaround is to open the page editor for each page and press the update button. This works for small sites but with larger ones it might be a lot of work.Is there a fix for this?
thx
ManuelNovember 16, 2020 at 12:14 pm #1533847ElvinStaffCustomer SupportHi Manuel,
Can you specify which tables did you do a better search replace?
GB’s code will appear like this on posts’ contents within the database under
wp_posts
table.<!-- wp:generateblocks/container {"uniqueId":"8efe5669","bgImage":{"id":169,"image":{"url":"http://elvin.wppluginsupport.net/wp-content/uploads/2020/11/d7c12733-5eb6-378a-96f0-40ea88e17650.jpg","height":746,"width":1120,"orientation":"landscape"}}} --> <div class="gb-container gb-container-8efe5669"><div class="gb-inside-container"></div></div> <!-- /wp:generateblocks/container -->
Say for this example, we want to replace
http://elvin.wppluginsupport.net
withhttp://www.yoursite.net
.We’ll have to do a better search and replace or these 2 strings on the
wp_posts
table.November 16, 2020 at 11:47 pm #1534207DominikHi Elvin,
I have selected all tables available and tried replacing many different string variations.
https://www.domain.com www.domain.com //www.domain.com /www.domain.com etc.
The structure of the page is very simple.
HTML
<div class="gb-container gb-container-d635c43a"> <div class="gb-inside-container"></div> </div>
CSS
gb-container.gb-container-d635c43a { background-image: url(//www.domain.com/picture.jpg); background-repeat: no-repeat; background-position: center center; background-size: cover; }
November 17, 2020 at 9:19 am #1535026TomLead DeveloperLead DeveloperThat’s strange – these are just simple strings in your content. Plugins should be able to replace them quite easily.
Any chance you can link us to one of the pages?
November 17, 2020 at 11:52 pm #1535625DominikSure, find the link in the private section. We already manually updated the URLs with hitting the update button on each page again. On this subpage the hero image was the problem. All other pictures worked fine from the beginning.
November 18, 2020 at 9:17 am #1536481TomLead DeveloperLead DeveloperAh, I see the issue.
The CSS for each page is built as a static CSS file so it can be cached.
Changing the URLs worked, but the CSS was still cached using the old URLs.
When this happens, simply go to “Settings > GenerateBlocks” and hit the Regenerate CSS Files button – this will automatically rebuild the CSS files for you so you don’t have to manually re-save each page.
November 19, 2020 at 1:17 am #1537187DominikThanks for the hint and your help :). For me it looks a lot like that’s the solution and I will try it next time.
November 19, 2020 at 9:20 am #1537908TomLead DeveloperLead DeveloperNo problem! 🙂
March 2, 2021 at 1:47 am #1678396IngoI run into the same (and I am looking for an automated solution)..
Is it also a ‘clean solution’ to ‘search-and-replace’ the URLs directly into the static CSS-Files? Say on the commandline with:
sed ‘s/old-domain/new-domain/g’ /wp-content/uploads/generateblocks/*.css
after a:
wp search-replace ‘old-domain’ ‘new-domain’ –report-changed-only
Or does generatepress itself support wp-cli?
Thank you for any comments on my topic,Ingo Baab
March 2, 2021 at 7:26 am #1678981ElvinStaffCustomer SupportHi there,
If I may suggest:
Better Search Replace plugin is usually enough for things like this: https://wordpress.org/plugins/better-search-replace/
About wp-cli:
WP-CLI isn’t theme dependent so you don’t have to worry about what theme you’re using.
March 18, 2021 at 3:43 am #1700035HO YANI have replaced the image url but the image didn’t change.
March 18, 2021 at 3:50 am #1700044IngoCaching?
wp cache flush
March 18, 2021 at 4:10 am #1700062HO YANI have cleared cache but nothing changes
March 18, 2021 at 6:26 am #1700242DavidStaffCustomer SupportHi there,
can you raise a new topic where you can share a link to your site and we can take a look.
April 28, 2022 at 7:09 am #2202788bjbowenIs there a way to avoid having to do this?
I’ve pulled my hair out trying to find out why I couldn’t get my images to show up after I moved from production to the live site.
Search replace with a plugin
Search/replace in the databaseCloning the site to another subdomain and then back to the live site… ONly to find that I have to go to GenerateBlocks and regenerate the CSS??
Whewwwwwww…. How can I avoid that because wow.
-
AuthorPosts
- You must be logged in to reply to this topic.