Wordpress网站使用siteground security optimizer 及 translatepress多语言插件的翻译问题 问题发现有的页面翻译出错如下图经排查原因是SiteGround 主机安全插件中的“锁定并保护系统文件夹”功能阻止了 TranslatePress 插件的trp-ajax.php文件正常执行。解决方法将trp-ajax.php加入白名单这个方法既能保留 SiteGround 的安全防护又能让 TranslatePress 正常工作。操作步骤先关闭SiteGround Security Optimizer 插件中的“锁定并保护系统文件夹”功能将以下代码添加到主题的functions.php文件中重新开启“锁定并保护系统文件夹”功能。add_filter( sgs_whitelist_wp_content, whitelist_trp_ajax ); function whitelist_trp_ajax( $whitelist ) { $whitelist[] trp-ajax.php; return $whitelist; }关键提示一定要先关闭该功能、添加代码、再重新开启。这样系统会重新生成.htaccess规则把trp-ajax.php排除在保护之外。只需要写文件名不需要写完整路径。