---
title: "Anti Spam en WordPress"
date: 2008-09-15
author: "Alex Borrás"
source: https://alexborras.com/anti-spam-en-wordpress/
site: "El Blog de Alex Borrás"
---

# Anti Spam en WordPress

Cuando se diseña una página Web con WordPress es habitual empezar a recibir al poco tiempo muchos comentarios a los artículos que en realidad son Spam con lo típicos enlaces a Casinos Online, Medicinas, etc.

Una forma de evitar esto es ir a Opciones->Discusión y desmarcar la opcion de Permitir Comentarios, esto no afecta a las entradas y páginas ya realizadas.

Para evitar estos mensajes es recomendable poner un filtro AntiSpam que haga alguna pregunta sencilla a quien está intentado escribir estos mensajes para discernir si es una persona real o si es un programa.

Un sistema para eisponer de este filtro AntiSpan es el math-comment que hace una pregunta de suma de número cambiando cada vez los dos números.

El readme.txt de este plugin es el siguiente:

Se deben seguir todos los pasos y cuando ya está instalado es necesario Hacer update desde options porque ni no no funciona.

This plugin can be installed in 5 easy steps:

\* Download the plugin (see “Downloads” above).  

\* Decompress the .zip archive and put the files into your plugins directory (/wp-content/plugins/) or into a sub directory of the plugins directory.  

\* Enable the plugin in the WordPress Plugins admin page.  

\* Go to Options / Math Comment Spam, adjust the options and save.  

Important: You need to save the options when you use this plugin the first time or if you have updated from a previous version.

\* Add code to the comments.php of your theme. In the following an example for the WordPress standard theme (Kubrick):

```

      <?php 
      /****** Math Comment Spam Protection Plugin ******/
      if ( function_exists('math_comment_spam_protection') ) { 
      	$mcsp_info = math_comment_spam_protection();
      ?> 	<p><input type="text" name="mcspvalue" id="mcspvalue" value="" size="22" tabindex="4" />
      	<label for="mcspvalue"><small>Proteccion de spam: Suma de <?php echo $mcsp_info&#91;'operand1'&#93; . ' + ' . $mcsp_info&#91;'operand2'&#93; . ' ?' ?></small></label>
      	<input type="hidden" name="mcspinfo" value="<?php echo $mcsp_info&#91;'result'&#93;; ?>" />
      </p>
      <?php } // if function_exists... ?>
```

Add this code for example right after the field for the website URL.
