Changing WordPress API key used for stats


3 Shares

3 Shares


×

Your API key is…

Some people prefer to maintain privately hosted WordPress installation than using WordPress.com 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 WordPress.com account such as WordPress.com 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 WordPress.com started merging Gravatar accounts. I was confused and now I have two API keys for two WordPress.com 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 WordPress.com 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 WordPress.com 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:

editing entry in phpMyAdmin

edit API key entry in wp_options-option_value

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 WordPress.com support.

Related post tags :
  • http://bhseos.com/ Jushun

    Thanks for that awesome posting. It saved MUCH time :-)

  • http://www.google.com Suchmaschine

    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…

  • http://www.vexite.com MV

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

  • http://bruneianaesthesia.com Nazir

    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 wordpress.com is not at all being helpful. the support page at http://en.support.wordpress.com/api-keys/#changing-the-api-key-used-for-stats 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.

  • http://www.vexite.com 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
3 Shares Twitter 1 Facebook 0 Google+ 2 Pin It Share 0 StumbleUpon 0 3 Shares ×
Like MV.Tech.Blog on Facebook!