Take Advantage of Bing to Handle 404 Errors

Last week Cal Evans announced the release of the Bing404 Plugin for WordPress, a plugin that takes advantage of the Bing Search Library for PHP released by the Interoperability @ Microsoft team. Cal did a great job with those articles and I’d recommend checking them out.

When using the Bing404 Plugin instead of users seeing the standard WordPress error when a page is not found, Bing is queried for results within your site and a list of possibly relevant links is shown instead.

Here, I’ll share with you our experience getting started using this Plugin.

How It Works

Usually, users will receive a 404 error and a search box when they request page on your site that doesn’t exist.


If you don’t see the WordPress error handling above, but instead see the default IIS 404 error below, don’t worry. We’ll take care of this in Step 4.


When you install the Bing 404 Plugin, Bing will be queried for pages within your site when someone gets a Page Not Found error.


Give it a try here: http://wordpress.visitmix.com/foo


Marco Tabini recorded a great screencast on YouTube that goes through the few simple steps to install the Plugin. It should take less than 5 minutes and consists of the following steps:

1. Install the Plugin

2. Get a Bing AppID

3. Configure the Plugin

4. Enable IIS Pass Through Error Handling (not covered by Marco)

5. Test It

1. Install the Plugin

The first thing you need to do is install the Plugin; it’s in the WordPress Plugin Gallery. The easiest way to do this is to go to Add New in the Plugins section of your WordPress admin and Search for Bing404 (all one word).


You should get one result, which you just need to Install.


Next, select Install Now.


This will download the Plugin to your wp-content/plugins folder. Now, just click on Activate Plugin.


2. Get a Bing AppID

Start by visiting http://www.bing.com/developers/createapp.aspx, which will prompt you for a LiveID.


Provide a few details about the application.


This will generate an AppID,which you need to copy for the next steps.


3. Configure the Plugin

Once you’ve activated the Plugin,you should have a new option for Bing 404 under the Settings in your WordPress admin.


Enter your Bing API Key, Site Specific Search and Number of rows to return and click Save Changes.


That’s it!

4. Enable IIS Pass Through Error Handling

This may be the most tricky/confusing issue. Even after you’ve installed and configured the Plugin, you may still see the default IIS 404 error message.


This is probably happening because IIS, by default, is configured to not show detailed error messages for security reasons. The best workaround is to enable PassThrough error handling. This will allow your application to handle errors and still hide sensitive configuration details from the end user.

If you aren’t already using a web.config for URL Rewrite, etc. just create a new file named web.config in the root of your site. It should have the following contents:

<?xml version="1.0" encoding="UTF-8"?>
        <httpErrors existingResponse="PassThrough" />

There’s a high likelihood that you already have a web.config for URL Rewrite.  In this case, you just need to add <httpErrors existingResponse=”PassThrough” /> to the <system.webServer> section of the file.

Checkout this post on iis.net for more details.

5. Test It

Now all you need to do is enter a URL that doesn’t exist on your site. Instead of the traditional WordPress 404 error page, Bing will be queried for results within your site and provide applicable links.


If you’re interested in digging deeper, Cal has another article that talks about using the Bing Search Library with some sample code.

Comments 15 Comments - Join the conversation

  1. If you use Windows Vista or Windows Server 2008 and install WordPress by using Web Platform Installer then there is no need to enable IIS pass through error handling as described in step #4. This is because Web Platform installer automatically installs the FastCGI update that fixes the error handling behavior in IIS FastCGI. If you do not already have this update then it is highly recommended to install it from here: http://ruslany.net/2010/03/important-update-for-iis-7-0-fastcgi-module/

    If you have Windows 7 or Windows Server 2008 R2 then you still need to enable IIS Pass Through error handling because the fix for those OS””es will be available in SP1 of Windows 7 / Windows Server 2008 R2.

  2. ZHUZHU says:

    There are other choice factors which experienced been used on most winter jackets but most appear short when when in comparison with goose down. They are instead appreciably more high-priced which signifies that Moncler jackets build from goose decrease aren””t precisely cheap. many Hollywood stars choose Moncler for that great as appreciably as they do for that stylish styles that ensure it is stylish to develop to be observed in one. Winter could be fashionable, pleasurable if you individual the exceptional great decrease jacket like a Moncler jacket from the coloring and design of your choice.http://www.thomassabomarkt.com/ts36-thomas-sabo-necklaces.html

  3. Bunny says:

    TYVM you””ve solved all my probemls

  4. Chacidy says:

    What a pleasure to find someone who ientdiifes the issues so clearly

  5. Lonnie says:

    Asking questions are truly fastidious thing if you are not understanding anything totally, however this piece of writing
    presents fastidious understanding yet.

  6. Nuptials harmony is all a way out of taste. picking a enormous harmony using the trick out apparel or ceremonial is very transverse that you pulling of your commendation with out a hitch! There are very several completely different factors to some nuptial rites commendation ceremonial and nuptial rites commendation receipt which make sure it is perfect. The few should look in any way factors from the huge day time to be seized of the skilfulness to make certain which they have every little thing in readiness to go. just one this sort of crops that should unfold to be determined upon antecedent in the aim of specific commendation could haply be the sort of nuptial rites commendation harmony that will most in all verisimilitude be simple body from the day. The drawn out-boundary bride and servant will need to look at nuptial rites commendation Dressesmusic for equally the nuptial rites commendation ceremonial and nuptial rites commendation receipt.

  7. Danial says:

    Wondrrful blog! I found it while browsing on Yahoo News.
    Do you have any tipss on howw tto get listed in Yahoo News?
    I’ve been trying for a while but I never seem to get there!
    Many thanks

  8. Hi, all is going perfectly here and ofcourse every one
    is sharing information, that’s actually good, keep up writing.

  9. I like the helpful info you provide in your articles.
    I will bookmark your blog and check again here regularly.
    I’m quite certain I’ll learn plenty of new stuff right here!

    Best of luck for the next!

  10. Article writing is also a excitement, if you be acquainted with
    after that you can write otherwise it is difficult to write.

  11. Joye R. Shin says:

    Hello There. I discovered your weblog the usage of msn. That is
    a very neatly written article. I will make sure to bookmark it
    and return to learn extra of your helpful information. Thanks for the
    post. I will certainly comeback.

  12. You need to be a part of a contest for one of the best sites
    online. I most certainly will recommend this web site!

  13. Hi friends, pleasant piece of writing and good
    arguments commented here, I am genuinely enjoying by these.

Add a Comment