Forums

Setting Akismet IP Exemptions (2 posts)

  1. blaker
    Member
    Posted 4 years ago #

    We're looking for a way to allow an IP in Akismet. We have a project where all of our comments are filtered through a source and so they're coming to the destination site via one IP. Akismet is catching them and even though we've declared it not spam, I suppose the volume of comments from that singular IP keeps it stuck as spam.

    So is there a way to set an IP exemption in the plugin editor somewhere? Like where we can permit, on our end, an IP that wouldn't be subject to Akismet's iron curtain?

  2. Otto
    Tech Ninja
    Posted 4 years ago #

    You can edit the Akismet plugin. Look for this bit of code:

    function akismet_auto_check_comment( $comment ) {
    	global $akismet_api_host, $akismet_api_port;
    
    	$comment['user_ip']    = preg_replace( '/[^0-9., ]/', '', $_SERVER['REMOTE_ADDR'] );

    Just after that, add something like this:
    if ($comment['user_ip'] == '127.1.1.1') return $comment;

    That will bypass Akismet for that IP.

Topic Closed

This topic has been closed to new replies.

About this Topic