WordPress启用Redis Object Cache这个插件后会在我们页脚自动添加<!–Performance optimized by Redis Object Cache. Learn more: https://wprediscache.comRetrieved 7176 objects (753 KB) from Redis using PhpRedis .–> 推广信息,免费给人家打广告不是我们的风格,删除Wordpress插件 Redis Object Cache 网页源代码页脚的推广信息,其实方法挺简单的找到以下文件,注释一部分代码即可解决。
方法1、宝塔登陆后台,找到Redis Object Cache 插件的路径,如下路径:wp-content/plugins/redis-cache/includes/class-plugin.php。
方法2、进入WP的后台-插件-插件编辑器,右上方选择Redis Object Cache插件,选择includes下的class-plugin.php进行修改。
方法3、直接FTP连接服务器,找到路径 wp-content/plugins/redis-cache/includes/class-plugin.php 进行修改即可。
具体的修改方法自行查看下面的图片参考,直接注释即可,删除也可以,不过容易出现问题

$message = sprintf(
'Performance optimized by Redis Object Cache. Learn more: %s',
'https://wprediscache.com'
);
if ( ! WP_DEBUG_DISPLAY ) {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
printf( "\n<!-- %s -->\n", $message );
return;
}
$bytes = strlen( serialize( $wp_object_cache->cache ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize
$debug = sprintf(
// translators: %1$d = number of objects. %2$s = human-readable size of cache. %3$s = name of the used client.
__( 'Retrieved %1$d objects (%2$s) from Redis using %3$s.', 'redis-cache' ),
$wp_object_cache->cache_hits,
function_exists( 'size_format' ) ? size_format( $bytes ) : "{$bytes} bytes",
$wp_object_cache->diagnostics['client']
);
printf(
"<!--\n%s\n\n%s\n-->\n",
$message, // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
esc_html( $debug )
);
















