How do I debug the Akismet plugin?

As of version 3.0.0, we have built debugging support into the Akismet plugin. This works with the debug system that is already in WordPress. Debug information is useful for identifying connection issues with the Akismet API that can prevent the plugin from working properly.

Between versions 3.0.0 and 3.3.3, Akismet will automatically log its debugging information if WP_DEBUG and WP_DEBUG_LOG are enabled. As of version 3.3.4, you must also enable AKISMET_DEBUG. In wp‑config.php, add a line that looks like this:

define( 'AKISMET_DEBUG', true );

Now the plugin will log debug information in the file /wp‑content/debug.log

If your site is in production, it is a good idea to update your .htaccess file to deny access to this log file. You need to add this rule;

<Files ~ "\.log$">
  Order allow,deny
  Deny from all

To turn off Akismet’s debugging, either remove this line:

define( 'AKISMET_DEBUG', true );

or replace it with this line:

define( 'AKISMET_DEBUG', false );

If you have general questions about Akismet, please contact us.