WP-Rocket是一款非常好用的缓存生成和管理插件,可以大大提高网站访问速度。但是,无论你是否付费,其开发人员都会在你的网站代码里留下注释广告。
注释代码如下
<!--
Performance optimized by Redis Object Cache. Learn more: https://wprediscache.com
Retrieved 4937 objects (745 KB) from Redis using PhpRedis (v5.3.4).
-->
如何删除WP-Rocket缓存插件在前台页尾添加的注释代码,解决方法,编辑以下路径里面的class-cache.php文件
路径:
/wp-content/plugins/wp-Rocket/inc/classes/Buffer/class-cache.php
大约在444行左右会看见这个 get_Rocket_footprint() 文件如下代码
private function get_rocket_footprint( $time = '' ) {
$footprint = defined( 'WP_ROCKET_WHITE_LABEL_FOOTPRINT' ) ?
"\n" . '<!-- Cached for great performance' :
"\n" . '<!-- This website is like a Rocket, isn\'t it? Performance optimized by ' . WP_ROCKET_PLUGIN_NAME . '. Learn more: https://wp-rocket.me';
if ( ! empty( $time ) ) {
$footprint .= ' - Debug: cached@' . $time;
}
$footprint .= ' -->';
return $footprint;
}
注释掉return $footprint;
即可
完成结果
private function get_rocket_footprint( $time = '' ) {
$footprint = defined( 'WP_ROCKET_WHITE_LABEL_FOOTPRINT' ) ?
"\n" . '<!-- Cached for great performance' :
"\n" . '<!-- This website is like a Rocket, isn\'t it? Performance optimized by ' . WP_ROCKET_PLUGIN_NAME . '. Learn more: https://wp-rocket.me';
if ( ! empty( $time ) ) {
$footprint .= ' - Debug: cached@' . $time;
}
$footprint .= ' -->';
// return $footprint;
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
评论(0)