400 Bad Request Nginx: WordPress.com Stats Problem [Solved]

I recently updated one of my Gadgets blog to WordPress 3.0. After updating the blog to latest 3.0 version, I enabled multiple site network option and for that I had to disable all the WordPress plugins. After making my WordPress 3.0 blog WordPress MU compatible blog, I reactivated all the plugins.  To make my WordPress.com stats plugin work, I had to add the WordPress API key again and once I added it, I started getting 400 Bad request Nginx error. Earlier I thought it’s because this plugin is not compatible with WordPress 3.0.

400 bad request nginx
400 bad request nginx

After bit of research I realize this 400 bad request error is because of error in putting API key. I have added one extra space after the API key and that’s why it is giving the error. If you face the similar issue, here is workaround for the same:

  • Deactivate WordPress.com stats plugin
  • Activate WordPress.com stats plugin
  • Add WordPress API key (Take care of space or any extra character)
Wordpress.com Stats plugin
Wordpress.com Stats plugin

Your WordPress.com will not be giving any error after this. Do let us know if this helped you or you still getting the same error?

12 Comments

Anant Shrivastava June 20, 2010

Good to see a quick workaround for such issues but i suppose this should go into the bug report and wordpress should be intelligent enough to strip white spaces around the text all by itself.

Also 400 error actually reminded me of 404 Error which is you all know what. i would like to see a review of 404-notifier and re-directions plugins (2 seperate plugin) to be covered in wpveda. they actually help a lot.

Roohi Moolla July 15, 2010

Thanks for posting this fix Anant!

Daan September 10, 2010

Can not get it to work..
Deactivated the plugin, but when i reactivate it, the API is already in place and i can not find where to edit it… :S

Harsh Agrawal September 11, 2010

Daan Remove the API key and reenter the API key and click on save button..!!
Hope this would help!!

Robbie September 12, 2010

I’m getting the same problem as Daan. I’m deactivating, reactivating and it already has the key. And it’s not giving me an option to edit the key. There must be some place I can edit it. I’m hosting this on my own server.

X September 14, 2010

Same problem as Daan and Robbie, no option to reset the key!

Daan September 19, 2010

Anyone?

Daan September 19, 2010

Got it… This worked for me:
1. Deactivate plugin.
2. Delete plugin via FTP
3. Refresh page, delete cookies, history.
4. Login again
5. Upload stats via ftp
6. go to plugins and activate plugin.
7. Than you can insert the API again.

Allan September 29, 2010

I tried this and am still having the problem. Tried three different browsers. Even downloaded new version of the stats app. Error is still there also has the active posts and top searches. There must be something that I am not clearing out. Even shows up in different browsers.

Allan October 9, 2010

Any support for the above error please. I now have it on two sites, both using the same API. The stats worked fine and then just started giving me the above error.

Daan Design October 10, 2010

Have you tried my solution above?
After you can insert the Api key, make sure it HAS NO SPACES IN IT, not in the front nor behind..

Allan October 21, 2010

Yes, I have tried your solution above. It still automatically inserts the API Key and does not request for me to put it in again. Cleared browser, cache, history, even switched browsers.