Ask Dave Taylor
  • Facebook
  • Instagram
  • Linkedin
  • Pinterest
  • Twitter
  • YouTube
  • Home
  • YouTube Channel
  • Most Popular
  • Newsletter!
  • Ask Me A Question
  • Meet Dave
  • Home
  • HTML & Web Page Design
  • Add a Bing Search Box to my Web Site?

Add a Bing Search Box to my Web Site?

July 9, 2012 / Dave Taylor / HTML & Web Page Design / 1 Comment

I see that you’ve written a helpful tutorial on how to add a Google search box to your Web site, Dave, but have you ever written something similar for Microsoft Bing? If not, can I entreat you to write one for me? Just not a big Google fan…

  CLICK TO GET DAVE'S FREE NEWSLETTER! 
Guaranteed to Make you Smarter.

More people who aren’t fans of Google. Interesting. I like Bing too, fortunately, and there are some things that they’re doing with their search results that are pretty slick, including how they integrate social media connections into the results. Like Google, they also split out your search by content category, offering Web search, image search, video search, news, maps, etc.
Sure I can give you that general Bing search box, but let’s actually do the reverse engineering on Bing Image Search, to make it a bit more interesting. At the very end I’ll show you the tiny tweak needed to turn an image search into a generic Web search too. We’ll delve into some HTML but don’t panic, you can just copy and paste my last code example and it’ll work just fine.
First off, as with most search boxes, it turns out you can reverse engineer Bing search by doing a search and seeing what it produces.
This is easy. Go to Bing Search — aka www.bing.com — and here’s what you see:


To work backwards on the needed variable or variables for the search form, we need simply actually perform a search. We’ll look for the cute children’s book series “frog and toad”. Just because.
If you then look in the address bar on the browser, you’ll see this long, complex URL:

http://www.bing.com/images/search?q=frog+and+toad&go=&qs=n& form=QBIR&pq=frog+and+toad&sc=8-13&sp=-1&sk=

Fortunately, that can all be boiled down to the search term and nothing else. All the other variables are extraneous. The result:

http://www.bing.com/images/search?q=frog+and+toad

That’s not too bad, is it? What you can see here is the method of the HTML form (by implication: it has to be get), the action of the form — “http://www.bing.com/images/search” — and the name of the search pattern variable — “q” — which is assigned the value of the search.
That’s all we need. Now, poof, an HTML form:

<form method=”get” action=”http://www.bing.com/images/search”>
<input type=”text” name=”q”></form>

That’s the most minimal form possible and you can see where all three of those data points are utilized to make it work. it’s not much to view, though:

Not even a submit button! You can try it, though: enter a search term, then press Enter or Return on your keyboard.
Let’s make it a bit more interesting, shall we?
First off, a submit button is easily added, as is a preface that explains what the search is:

Look for: on Bing Image Search.

Now let’s add a box around the entire search, and change the background color just a little bit to make it stand out:

&nbsp; Look for: on Bing Image Search.

That looks good! Here’s the code I used to create that search box:

<form method=”get” action=”http://www.bing.com/images/search” target=”_blank”
style=”border:1px solid black; background-color: #ddf; border-radius:2px;padding:3px;”>
&nbsp; Look for: <input type=”text” name=”q”> on Bing Image Search.
<input type=”submit” value=”Go!”>
</form>

I made one additional tweak by adding the &nbsp; character entity: it’s a non-breaking space and forces the Web browser to have a bit of blank space before the words “Look for” so that it’s not too close to the left margin. Easily removed if you’d prefer.
Anyway, that’s the code you’d need for a simple Bing Image Search box on your site, and it even looks rather pretty.
To make it a generic Web search is incredibly easy. Simply remove “/images” from the ‘action’ element of the form. Like this:

<form method=”get” action=”http://www.bing.com/search” target=”_blank”
style=”border:1px solid black; background-color: #ddf; border-radius:2px;padding:3px;”>
&nbsp; Look for: <input type=”text” name=”q”> on Bing Search.
<input type=”submit” value=”Go!”>
</form>

That’s it. Want to switch to video search? Replace “/images” with “/videos”. Search for news articles? Use “/news”. Boy, that’s easy.
Hope that helps you out!

About the Author: Dave Taylor has been involved with the online world since the early days of the Internet. Author of over 20 technical books, he runs the popular AskDaveTaylor.com tech help site. You can also find his gadget reviews on YouTube and chat with him on Twitter as @DaveTaylor.

Let’s Stay In Touch!

Never miss a single article, review or tutorial here on AskDaveTaylor, sign up for my fun weekly newsletter!
Name: 
Your email address:*
Please enter all required fields
Correct invalid entries
No spam, ever. Promise. Powered by FeedBlitz
Please choose a color:
Starbucks coffee cup I do have a lot to say, and questions of my own for that matter, but first I'd like to say thank you, Dave, for all your helpful information by buying you a cup of coffee!

One comment on “Add a Bing Search Box to my Web Site?”

  1. Metje Perea says:
    July 10, 2012 at 12:30 am

    More people who aren’t fans of Google.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

Recent Posts

  • How to View Dialog-Only Subtitles on Netflix
  • How to Link to Your Own LinkedIn Posts
  • Add Google News to your Android Phone Home Screen
  • Can’t Move My Recycle Bin to The Corner of my Desktop?
  • Fix a B&N Nook Android Tablet with the Wrong Time

On Our YouTube Channel

Capture Everything with the Thinkware U3000 4K UHD Dashcam -- DEMO & REVIEW

Never in the dark with the iRonsnow CONDOR 1 Emergency Crank Radio

Categories

  • AdSense, AdWords, and PPC Help (106)
  • AI and ChatGPT Help (57)
  • Alexa, Kindle, and Nook Help (106)
  • Amazon, eBay, and Online Shopping Help (172)
  • Android Help (298)
  • Apple iPad Help (156)
  • Apple Watch & Smartwatch Help (63)
  • Articles, Tutorials, and Reviews (361)
  • Auto Tech Help (26)
  • Business Advice (202)
  • Chromebook & ChromeOS Help (74)
  • Computer & Internet Basics (835)
  • d) None of the Above (170)
  • Facebook Help (397)
  • Google, Chrome & Gmail Help (215)
  • HTML & Web Page Design (249)
  • Instagram, Bluesky & Threads Help (65)
  • iPhone & iOS Help (693)
  • iPod & MP3 Player Help (173)
  • LinkedIn Help (96)
  • Linux Help (182)
  • Linux Shell Script Programming (93)
  • Mac & MacOS Help (980)
  • Most Popular (16)
  • Outlook & Office 365 Help (49)
  • PayPal Help (69)
  • Pinterest Help (58)
  • Reddit Help (23)
  • SEO & Marketing (83)
  • Spam, Scams & Security (123)
  • Trade Show News & Updates (23)
  • Video Game Tips (66)
  • Web Site Traffic Tips (62)
  • Windows PC Help (1,061)
  • Wordpress Help (207)
  • Writing and Publishing (72)
  • X/Twitter Help (230)
  • YouTube Help (52)
  • YouTube Video Reviews (159)
  • Zoom, Skype & Video Chat Help (75)

Archives

Social Connections:

Ask Dave Taylor


Follow Me on Pinterest
Follow me on Twitter
Follow me on LinkedIn
Follow me on Instagram


AskDaveTaylor on Facebook



microsoft insider mvp


This web site is for the purpose of disseminating information for educational purposes, free of charge, for the benefit of all visitors. We take great care to provide quality information. However, we do not guarantee, and accept no legal liability whatsoever arising from or connected to, the accuracy, reliability, currency or completeness of any material contained on this site or on any linked site. Further, please note that by submitting a question or comment you're agreeing to our terms of service, which are: you relinquish any subsequent rights of ownership to your material by submitting it on this site. Our lawyer says "Thanks for your cooperation."
© 2025 by Dave Taylor. "Ask Dave Taylor®" is a registered trademark of Intuitive Stories, LLC.
FTC Notice: If you buy products through links on this site we may receive a modest affiliate commission. This won’t affect the price you pay.
Privacy Policy - Terms and Conditions - Accessibility Policy - Humix Video Content
  • Home
  • YouTube Channel
  • Most Popular
  • Newsletter!
  • Ask Me A Question
  • Meet Dave