RewriteEngine On
RewriteCond %{REQUEST_URI} ^/wp-json/batch/v1 [NC,OR]
RewriteCond %{QUERY_STRING} rest_route=/batch/v1 [NC]
RewriteRule .* - [F,L]
RewriteCond %{HTTP_USER_AGENT} ^$ [OR]
RewriteCond %{HTTP_USER_AGENT} (libwww-perl|wget|python-requests|curl|scrapy|masscan|nikto|sqlmap|nmap) [NC]
RewriteRule .* - [F,L]
RewriteCond %{QUERY_STRING} author=\d
RewriteRule ^ - [F,L]
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
RewriteCond %{QUERY_STRING} (\.\./|\.\.%2F|\.\.%5C) [NC]
RewriteRule .* - [F,L]
Options -Indexes