网站建设

常用正则替换规则记录

指定页面sitemap->链接排除

/\?.*?/
##########
/javascript/
##########
/\s/
##########
/#/
##########

通用去除meta杂标签正则

/<(meta|link) (property|name|rel|itemprop)="(eclick_verify|geo|ICBM|dns|revisit|copyright|fb|google|og|tw|apple|canonical|alternate|article|author|news|amphtml|dmca|preload|EditURI|onesignal|shortcut icon|preconnect|Googlebot-News|robots|generator|shortlink|copyright|abstract|distribution|pubdate|dateModified|alexaVerifyID|wlwmanifest|profile|pingback|https:\/\/api.w.org\/).*?>/~~~~~~<!--meta-->
##########
/<(meta|link) (property|name|rel|itemprop)='(eclick_verify|geo|ICBM|dns|revisit|copyright|fb|google|og|tw|apple|canonical|alternate|article|author|news|amphtml|dmca|preload|EditURI|onesignal|shortcut icon|preconnect|Googlebot-News|robots|generator|shortlink|copyright|abstract|distribution|pubdate|dateModified|alexaVerifyID|wlwmanifest|profile|pingback|https:\/\/api.w.org\/).*?>/~~~~~~<!--meta-->
##########
/<(meta|link) (property|name|rel|itemprop)=(eclick_verify|geo|ICBM|dns|revisit|copyright|fb|google|og|tw|apple|canonical|alternate|article|author|news|amphtml|dmca|preload|EditURI|onesignal|shortcut icon|preconnect|Googlebot-News|robots|generator|shortlink|copyright|abstract|distribution|pubdate|dateModified|alexaVerifyID|wlwmanifest|profile|pingback|https:\/\/api.w.org\/).*?>/~~~~~~<!--meta-->
##########
/window.dataLayer.*?<\/script>/s~~~~~~<!--gtags.js--></script>
##########
/<script async src="https:\/\/www.googletagmanager.com\/.*?<\/script>/~~~~~~<!-- googletagmanager  -->
##########
/<noscript>.*?<\/noscript>/s~~~~~~<!-- noscript  -->
##########
/<script type="application\/ld\+json">.*?<\/script>/s~~~~~~<!--application\/ld\+json-->
##########
/<script async.*?<\/script>/~~~~~~<!--script async-->
##########
/<ins .*?<\/ins>/s~~~~~~<!--ins-->
##########
/<script>\(adsbygoogle.*?<\/script>/~~~~~~<!--adsbygoogle-->
##########

其实这个标签去除,还可以改成下面这样,除去更加彻底

/<(meta|link).*?(property|name|rel|itemprop)="(eclick_verify|geo|ICBM|dns|revisit|copyright|fb|google|og|tw|apple|canonical|alternate|article|author|news|amphtml|dmca|preload|EditURI|onesignal|shortcut icon|preconnect|Googlebot-News|robots|generator|shortlink|copyright|abstract|distribution|pubdate|dateModified|alexaVerifyID|wlwmanifest|profile|pingback|https:\/\/api.w.org\/).*?>/~~~~~~<!--meta-->



编辑:

阅读量:46

url链接:http://www.qozr.com/cms_chang-yong-zheng-ze-ti-huan-gui-ze-ji-lu.html

Tag标签: 正则

同类新闻

更多新闻

Copyright © 2007-2023 千欧中软 版权所有 http://www.qozr.com seo | 网站建设 [渝ICP备15005074号]