WordPress建站教程:解决WPBakery Page Builder导致的后台缓慢问题
作者:悦然WordPress建站(悦然建站)
继续分享WordPress建站教程。最近在做WordPress建站项目时遇到一个比较头疼的问题,那就是网站后台卡顿,在编辑页面或写文章时感觉特别明显。
Continuing our WordPress tutorial series. Recently while working on a WordPress project, I encountered a frustrating issue - the admin backend was extremely slow, especially noticeable when editing pages or writing posts.
问题描述:如上图所示,当我新建一篇文章时,要1分钟左右编辑器才能正常加载,后来我试过禁用谷歌字体,禁用古腾堡编辑器都是一样的效果。
Problem description: As shown in the image above, when creating a new post, it took about 1 minute for the editor to load properly. I tried disabling Google Fonts and Gutenberg editor, but saw no improvement.
查找原因:刚开始我以为是谷歌字体问题,但前面说过了,禁用谷歌字体还是慢,没什么效果。没办法我只能一个个尝试,最终发现可能是页面编辑器的问题。
Troubleshooting: Initially I suspected Google Fonts, but as mentioned, disabling them didn't help. After testing various possibilities, I determined the page builder was likely the culprit.
这个WordPress站点使用的是Salient主题,这款主题在主题森林上的销量还是非常高的,也比较受欢迎,它配套的页面编辑器是WPBakery Page Builder。
This WordPress site uses the Salient theme, a very popular theme on ThemeForest that comes bundled with WPBakery Page Builder.
使用了WPBakery Page Builder编辑器之后,WordPress建站后台不管是操作页面还是编写文章都会默认加载WPBakery Page Builder编辑器,而这款编辑器加载的资源非常多,这可能就是导致卡顿的主要原因了。
With WPBakery Page Builder enabled, the WordPress admin loads this editor by default for both page editing and post writing. Since this editor loads numerous resources, it's likely the main cause of the slowdown.
解决方法:因为这个WordPress建站项目不得不使用Salient主题,做的是外贸建站,主题也是客户自己选的。这款主题又是在WPBakery Page Builder基础上开发的,所以我并没有找到很好的解决方法,不过找到了一个勉强可行的方法。
Solution: Since this project required using the Salient theme (chosen by the client for their foreign trade site) which is built on WPBakery Page Builder, I couldn't find a perfect solution, but did discover a workaround.
进入WordPress建站后台,打开【WPBakery Page Builder】菜单,打开【Role Manager】,找到【Backend editor】选项,选【Disabled】禁用后端编辑器。这样当我们在编写文章时就不会卡顿了。
In WordPress admin, go to WPBakery Page Builder → Role Manager → set Backend editor to Disabled. This prevents the editor from loading when writing posts.
但是禁用后端编辑器后我们就不能再编辑WPBakery Page Builder创建的页面的,比如首页等,所以我们要在网站全部做好之后再关闭【Backend editor】,当我们继续再次编辑页面时,则需要开启【Backend editor】。
Note that disabling the backend editor means you can't edit WPBakery-created pages (like the homepage). So disable it only after completing site development, and re-enable when needing to edit pages again.
