Changing WordPress API key used for stats


Some people prefer to maintain privately hosted WordPress installation than using because you have more control and freedom using a privately hosted WordPress blog. However, there are certain features that you have to unlock or activate using a account such as Stats and Akismet.

Today, I tried to change the API key that I am using for my blog because I recently restructured my blog and cleaned things up. I couldn\’t remember how or when did started merging Gravatar accounts. I was confused and now I have two API keys for two accounts but I have activated my WordPress Stats using the wrong account. Yeah, I know it is confusing, but to get to the point, I have to change the WordPress API key I used for the stats, and also with Akismet.

The instruction found in support is helpful to a certain extent. You can go and check how to change the API up to step #6.

After doing step #6 however, I didn\’t get the \”Please enter an API key\” warning but I went through and disabled the plugin and reactivating it again.  Clicking Stats from the admin menu didn\’t prompt me to change the API key. It just tells me that user \”xxxx\” is not authorized to view the stats of this blog.

At this point I didn\’t know what I have done wrong because I followed the steps correctly. If you have the same problem take note that you have to follow steps #1 to #6 on how to change the API key before you proceed here.

I thought that If the API setting is not in custom configuration, it must be in the database. It must be.

So I used phpMyAdmin to search my WordPress tables for keywords like \”%API%\” (with wildcard) and I found several entries. You should be interested in wp_options table where you can find stats_options entry under option_name field and you should only edit the option_value entry. Check the screenshot below for reference:


You should see the old API key. Change that with the new one, then save it. That\’s all you have to do here. After that, go to the admin menu, click Site Stats and you should be able to view your website\’s statistics already.

I hope this helps. If it doesn\’t work, you can always contact support.

Related post tags :
  • Thanks for that awesome posting. It saved MUCH time :-)

  • yeah,I just thought you might want to know that your blog is messed up when you view it on my iphone. I?m not sure if it has something to do with my phone?s browser or your website? just saying…

  • MV

    @Suchmaschine, I think it’s my theme. I am tweaking it now for iPhone & iPad. Thanks!

  • I had searched everywhere, but could not find the riight way to reset the stats api key. It is such a simple problems that every other person is having, and is not at all being helpful. the support page at is correct upto point no.4 after which there is no button to add user.
    Anyways your tutorial saved me a lot of headache. It was very easy to find the correct entry, from your detailed description.
    Unfortunately, the entry in my database was different. my wrong api key together with wrong username appeared twice, so I copied the whole entry to a notepad and then deleted everything. on refreshing my dashboard, everything was like new. wordpress stats asked for an api key and i enterd the correct api key and it worked like charm.

  • MV

    @Nazir, I believe that page is not up-to-date. Luckily I found my way out of this API key issue by troubleshooting and searching the back-end. Glad that I helped.

  • Pingback: Hell's Belle » Blog Archive » Untying The Gordian Knot()

  • Pingback: Untying The Gordian Knot | Hell's Belle()

  • Pingback: Untying The Gordian Knot | Night Gallery()

  • Pingback: Untying The Gordian Knot » Hells Belle()

  • Pingback: Untying The Gordian Knot - Hells Belle()

Scroll to Top