复制粘贴到主题的 functions.php 最后一个?>之前
// 网站被恶意镜像怎么办 add_action('wp_footer','lxtx_deny_mirrored_websites'); function lxtx_deny_mirrored_websites(){ $currentDomain = 'www" + ".shfwpt." + "com'; // $currentDomain = '"shfwpt." + "com"'; echo '<img style="display:none" src=" " onerror=\'this.onerror=null;var str1="'.$currentDomain.'";str2="docu"+"ment.loca"+"tion.host";str3=eval(str2);if( str1!=str3 && str3!="cache.baiducontent.com" && str3!="webcache.googleusercontent.com" && str3!="c.360webcache.com" && str3!="cncc.bingj.com" && str3!="snapshot.sogoucdn.com" ){ do_action = "loca" + "tion." + "href = loca" + "tion.href" + ".rep" + "lace(docu" +"ment"+".loca"+"tion.ho"+"st," + "\"' . $currentDomain .'\"" + ")";eval(do_action) }\' />'; }