Windows Live Writer vs. Bad Behavior - Solved!

calendar Posted on June 6, 2007   comments 4 Comments

Last week I wrote about my battle getting Windows Live Writer Beta 2 to work with the (indispensable) Bad Behavior plugin.

I'm pleased to say that I've found a simple little work-around. Maybe not a permanent solution but for now it will definitely suffice. Easy to do, too!

There's a file included with Bad Behavior, in the /wp-content/plugs/bad-behavior/bad-behavior subdirectory, named whitelist.inc.php. I simply edited that file and found the section for user agent whitelisting.

What's a user agent?

A user agent is the client application used with a particular network protocol; the phrase is most commonly used in reference to those which access the World Wide Web. Web user agents range from web browsers to search engine crawlers ("spiders"), as well as mobile phones, screen readers and braille browsers used by people with disabilities.

A lot of the BB magic is done via user agent analysis (or at least, that's my assumption).

After a quick glance at my web server logs, I changed that section in the code to look like this:

PHP:
  1. $bb2_whitelist_user_agents = array(
  2.     "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Windows Live Writer 1.0)"
  3. );

Bingo! Now it works just fine. As long as the spammers don't change their user agents to be the same... but even if they get past Bad Behavior, I still have Akismet to catch 'em.

tags Tags: , , , ,

Related Posts Possibly Related Posts

Comments

4 Responses to “Windows Live Writer vs. Bad Behavior - Solved!”

  1. Lincoln on June 6th, 2007 8:43 pm

    You are, da MAN! Is he not Da Man? He is Da MAN! :-D

  2. Chris on June 6th, 2007 8:54 pm

    Aw shucks. :)

  3. Joe Cheng [MSFT] on June 6th, 2007 11:26 pm

    Good to know, thanks! Something for other readers to note is that Writer will (I believe) base its own user-agent string on the version of IE that’s installed on your computer. So that exact user-agent string may not work for you (for example if you’re on Vista).

  4. Chris on June 6th, 2007 11:41 pm

    Joe - thanks for that, good to know!

    For the readers, I’m running IE7 on XP on my bloggin’ machine. If you are too, then that user-agent string is good to go. If not, disable BB, hit your site, then check your web logs to get the proper string (and the don’t forget to re-enable BB!).

Leave a Reply




Have you read the Comments section on the Disclaimer page?

About

Wandering the Internet, looking at all things bright and shiny. Playing with many, writing about some. More …

Recent Posts

Recent Comments: