Cloudflare protection of WordPress

Cloudflare protection of WordPress

This is 3 firewall rules that we are using on some websites and that gives extra layer of protection for WordPress. Create firewall, use expression builder and copy&paste this rules.

Block of bad bots

(http.user_agent contains “Yandex”) or (http.user_agent contains “muckrack”) or (http.user_agent contains “Qwantify”) or (http.user_agent contains “Sogou”) or (http.user_agent contains “BUbiNG”) or (http.user_agent contains “knowledge”) or (http.user_agent contains “CFNetwork”) or (http.user_agent contains “Scrapy”) or (http.user_agent contains “SemrushBot”) or (http.user_agent contains “AhrefsBot”) or (http.user_agent contains “Baiduspider”) or (http.user_agent contains “python-requests”) or (http.user_agent contains “crawl” and not cf.client.bot) or (http.user_agent contains “Crawl” and not cf.client.bot) or (http.user_agent contains “bot” and not http.user_agent contains “bingbot” and not http.user_agent contains “Google” and not http.user_agent contains “Twitter” and not cf.client.bot) or (http.user_agent contains “Bot” and not http.user_agent contains “Google” and not cf.client.bot) or (http.user_agent contains “Spider” and not cf.client.bot) or (http.user_agent contains “spider” and not cf.client.bot)

Block admin access out of specific country (in example: Serbia)

((http.request.uri.path contains “/xmlrpc.php”) or (http.request.uri.path contains “/wp-login.php”) or (http.request.uri.path contains “/wp-admin/” and not http.request.uri.path contains “/wp-admin/admin-ajax.php” and not http.request.uri.path contains ” /wp-admin/theme-editor.php”)) and ip.geoip.country ne “RS”

Block direct url request to suspicious urls

(http.request.uri.path contains “/wp-include/” and http.request.uri.path contains “.php” and not (http.request.uri.path contains “/wp-content/plugins/”))

Some 3rd party plugins can have issues with some rules, test functionalities before leaving it forever.
You can check detail explanation and conversations on this url https://blog.runcloud.io/cloudflare-firewall-rules/

Twitter
Facebook
LinkedIn
Telegram
WhatsApp
Email