代码:

/* 获取用户真实IP地址 */
if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
 $list = explode(',',$_SERVER[\'HTTP_X_FORWARDED_FOR']);
 $_SERVER['REMOTE_ADDR'] = $list[0];
}

将上述代码复制到wp-config.php,保存后CDN更新目录即可。