Support » Fixing WordPress » API key not working in akismet

  • Hi,

    I signed up for a account last night, username axb21. That went smoothly and I was given an API key which I’ve been attempting to use to activate akismet on my blog hosted at . However, every time I’ve tried the key, I get this error:

    Your key appears invalid. Double-check it.

    I’ve tried cutting-and-pasting the key, typing it, using caps or lowercase. Nothing seems to work.

    Any thoughts would be appreciated. Thanks,


Viewing 6 replies - 1 through 6 (of 6 total)
  • Please be sure to use the Search to see if someone has asked this question already.

    Anyway, here is your answer:

    Thanks for the info. It remains to be seen if that’s my answer. I control the server hosting my blog, and I know outgoing traffic is not blocked. So if you’re right then this 24-48 hour ‘waiting period’ is the only thing it could be. At least I can try being patient for a day or two.

    As for searching, I did that, but the thread you pointed out didn’t come up. Call me dopey, but none of the search terms I used caught that post (or maybe they did and I was too lazy to check back in time that far, who knows). It seems to me that ought to alert new users of this ‘waiting period’ at time of signup. Because a lot of people are going to do exactly what I did: sign up on to get an API key to activate akismet, only to find that the key doesn’t work right away. So I think I’ll contact someone at with this question, see if there really is such a waiting period, and suggest that they alert new users that they might have to wait 24-48 hours to use their new key. Honestly I’m still skeptical of that, as it doesn’t make sense to me that you should have to wait — I verified my account via the email mechanism, so what’s being achieved by waiting longer?

    Thanks again,


    Anthony, I think it has more to do with Akismet itself than The 24-48 hour wait period was suggested earlier when I was having the problem (I can’t remember the initial thread I discoved it on, sorry).

    As for the post not showing up in the search, it’s because the original author decided to misspell Akismet as “Askimet”.

    Well, this problem continues to perplex me, but I have a workaround. Unfortunately, though it works for now I don’t know why this workaround is needed. I thought I’d detail what I tried and saw in case it helps someone else who is experiencing a similar issue.

    On the suggestion of a helpful individual with wordpress support, I obtained the debug version of akismet. That keeps a log in /tmp/akismet.log. I edited the akismet.php file to log more detail than it was giving by default, and eventually found that akismet was having trouble connecting to the akismet servers after all. I was getting errno 11, “Resource temporarily unavailable” from the call to fsockopen. Increasing or decreasing the timeout length didn’t help.

    This made no sense to me because I tried a bunch of different ways of connecting to the akismet servers from the command line, and they all worked fine (lynx and telnet, for instance). nslookup had no problems looking up the IP addresses of these domains. But it looked like the call to fsockopen was timing out.

    On a whim, I changed the fsockopen call in akismet.php, hardcoding the IP address of the server where the API key validation is done. Poof, the key validation suddenly worked fine. Then I put an entry for that server in /etc/hosts and changed the PHP file back to how it was originally, and that worked too. There is a second server akismet contacts (I suppose to get/send data about spam) which I also hardcoded into /etc/hosts. For the past day and a half or so all functions of the plugin are working fine.

    This is obviously unsatisfactory because those IP addresses may change. But it works for now.

    I find it bizarre. I don’t understand what fsockopen is doing under the hood well enough to guess why it would successfully look up a domain name from /etc/hosts but fail to from DNS (I verified the nobody user has permission to do DNS lookups).

    I saw a bug report for PHP 4.3 (which is what I’m stuck with, unfortunately) stating that fsockopen does not distinguish DNS lookup errors from other kinds of connection errors. So it seems like I’m not going to be able to get more detail about what’s going wrong without working hard…

    In any event, it looks to me like wordpress is doing what it should be doing, so I’ll take this up with akismet. I think my problem is probably related to some issue on my server, maybe with this older version of PHP. Thanks to everyone who offered suggestions, I appreciate the help.


    I was having trouble validating my api key on my hosted site

    I had already validated it on my own locally hosted server and so I knew it was something to do with my hosted site

    I contacted my host provider and asked them to set up 2 firewall rules for my site:


    Once this was done I was able to validate my api key on my site

    Had the same issue. Took some work but this worked: changed around line 175

    if( false != ( $fs = @fsockopen($host, $port, $errno, $errstr, 10) ) ) {


     if( false != ( $fs = @fsockopen($ip, $port, $errno, $errstr, 10) ) ) {

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘API key not working in akismet’ is closed to new replies.