站长朋友们在使用wordpress建站以后,当网站上线以后,经常会受到一些恶意侵害,有的是尝试破解后台密码的,有的是遭遇到恶意的URL链接请求。这篇wordpress教程里我们主要讲解一下如何让防止WordPress网站遭受恶意的URL链接请求。解决的思路是检查下访问的URL链接长度是否小于255,是否包含 “eval(”或者 “base64”字符串,这些都是一些恶意URL链接请求的特征,但是此方法可能会和Google Custom Search有冲突。
切换到主题目录,打开functions.PHP,输入以下代码:
Crayon-5c891d17cea1a779063338" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">functions.PHP
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-mixed-highlight" title="Contains Mixed Languages">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-language">PHPCrayon-button-icon">
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">
Crayon-nums " data-settings="show"> Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;"> Crayon-num" data-line="Crayon-5c891d17cea1a779063338-1">1 Crayon-num" data-line="Crayon-5c891d17cea1a779063338-3">3 Crayon-num" data-line="Crayon-5c891d17cea1a779063338-5">5 Crayon-num" data-line="Crayon-5c891d17cea1a779063338-7">7 Crayon-num" data-line="Crayon-5c891d17cea1a779063338-9">9 | Crayon-code">