专研WordPress,B端网站建设及引流

SiteGround切换域名后丢失图片的解决

出现的问题

siteground logo black transparent 400x81

从临时域名切换到主域名、并启用webp后,附件中的webp格式图片全部丢失了。

咨询SG人工,得到的答案是开了webp之后,如果把它关闭,所有自动生成的图片文件都会同步被删掉。

解决方案

还好siteground每天会自动备份数据,请客服帮忙恢复数据后,SG客服同时给出了两个建议,总结起来就是两句话:

这个开关在建站之初就好设置好,以后不能再改,否则会删掉手动上传的webp格式图片

定期在SG后台File Manager手动备份图片数据到其它文件夹,copy/paste即可

When you disable the Use WebP Images feature of SiteGround Optimizer, all WebP images are removed from your application. When you have WebP images, directly used by your application, they are removed, and cannot be recreated because there are no jpeg or png images from which to recreate them.

In order to resolve the issue, our System Administrators restored the images from a backup of your previous domain name, and they are now present and loading as expected:

The backup images are located at:

~/www/XXXX.com/image_backups

In order to avoid such issues in the future, I recommend saving a backup of your wp-content/uploads folder somewhere outside of the document root of your website, before changing the domain name or activating the WebP conversion.