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.

To turn off debugging in WordPress, you need to open your wp-config.php file and make sure WP_DEBUG is set to false.

define('WP_DEBUG', false);

To turn on debugging in WordPress, you need to replace this line:

// Enable WP_DEBUG mode
define('WP_DEBUG', true);

with the following:

// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);

// Disable display of errors and warnings
define('WP_DEBUG_DISPLAY', false);

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