# 1 WP Plug-in
Wordpress, confira o seguinte, você pode ou não precisar de um plug-in
- Leia este link para discutir vários plugins WP anti-spam e sintonizar a configuração do WP para que você não precise de plugins.
- Top 10 do plugin anti-spam do WP
- Página do plug-in do Wordpress
Como você tem controle sobre o servidor web, a instalação do plugin não deve ser um problema.
# 2 IIS Web.config
O bloqueio de base de IP pode ser feito com o IIS Web.config, seguindo um exemplo para permitir todos, exceto o bloqueio de IPs específicos
<security>
<ipSecurity allowUnlisted="true"> <!-- this line allows everybody, except those listed below -->
<clear/> <!-- removes all upstream restrictions -->
<add ipAddress="83.116.19.53"/> <!-- blocks the specific IP of 83.116.19.53 -->
<add ipAddress="83.116.119.0" subnetMask="255.255.255.0"/> <!--blocks network 83.116.119.0 to 83.116.119.255-->
<add ipAddress="83.116.0.0" subnetMask="255.255.0.0"/> <!--blocks network 83.116.0.0 to 83.116.255.255-->
<add ipAddress="83.0.0.0" subnetMask="255.0.0.0"/> <!--blocks entire /8 network of 83.0.0.0 to 83.255.255.255-->
</ipSecurity>
</security>
Mais informações neste link .
# 3 reescrita do IIS Web.config
Encontrado após aqui talvez você possa tentar.
<!-- Heading for the XML File -->
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<!-- This is where the rules start, this one will block EVERYTHING on your site with the <match url=".*" /> -->
<rules>
<rule name="Blocked Users" stopProcessing="true">
<match url=".*" />
<conditions>
<!-- This will just go to the 'Bad Ips' rewriteMap below and compare it to the REMOTE_ADDR which is the requesting IP -->
<add input="{Bad Ips:{REMOTE_ADDR}}" pattern="1" />
</conditions>
<!-- Actions can be Custom Rewrite, Redirect, or Just Abort Request, uncomment examples as needed -->
<action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
<!-- This one will rewrite url to specified file
<action type="Rewrite" url="error.html" appendQueryString="false" /> -->
<!-- This on will redirect to another site
<action type="Redirect" url="http://www.google.com" appendQueryString="false" /> -->
<!-- This one will just Abort
<action type="AbortRequest" /> -->
</rule>
</rules>
<!-- This rewrite Map is where you choose your blocked IP's, values with 1 are blocked, all others are ignored, simple add your keys -->
<rewriteMaps>
<rewriteMap name="Bad Ips">
<!-- This one will use wildcards -->
<add key="108.166.*.*" value="1" />
<!-- This one wil use static IP -->
<add key="12.13.15.16" value="1" />
</rewriteMap>
</rewriteMaps>
</rewrite>
</system.webServer>
</configuration>