Ask Dave Taylor
  • Facebook
  • Instagram
  • Linkedin
  • Pinterest
  • Twitter
  • YouTube
  • Home
  • YouTube Videos
  • Top Categories
  • Subscribe via Email
  • Ask A Question
  • Meet Dave
  • Home
  • HTML & Web Page Design
  • How Can I Add A Walmart.com Search Box to my Web Site?

How Can I Add A Walmart.com Search Box to my Web Site?

September 12, 2020 / Dave Taylor / HTML & Web Page Design / No Comments

I’m not a fan of Amazon.com and would like to have my friends shop at Walmart online instead. To help, I want to have a Walmart search box right on my own home page. Is that possible? How can I make that work and what code do I need? Note that I’m not much of a programmer…

Amazon has been facing somewhat of a backlash recently with people due to its business practices and the personal philosophy of its head honcho, Jeff Bezos. I’m not entirely sure that the other retail behemoth Walmart is much better, but you ask for a search box, I’ll give ya a search box. Fair?

The trick to any search for another site is to reverse engineer how an existing search works already. And the best and easiest way to do that is to search for something and then pay attention to the resultant URL on the search results page. In this instance, I’ve been shopping around for the weirdly fun and entertaining board game Pandemic: Reign of Cthulhu. I mean, pandemics and Cthulhu in the same game? What’s not to love, right? 🙂

If I jump over to Walmart.com, the search box is front and center on the top bar:

walmart.com top search box

Start typing in it and you’ll get search suggestions:

walmart search suggestions - pandemic

I should warn you that getting suggestions to pop up involves a lot of code so we’re going to ignore that in the simple search form we’ll create for your site. If you want that, you’re going to be doing a lot more coding and I don’t think that it’s particularly necessary (though it is useful, as we’ve all learned in the last few years as these have gained popularity).

The last of the suggestions is the game I seek – Pandemic: Reign of Cthulhu – so I’ll just click on that. Here’s the result:

walmart.com search results - pandemic reign of cthulhu

First match. Nice. But, um, we don’t want to buy the game, we want to figure out how search works on Walmart.com!

To do that, look closely at the resultant URL from the search results page:

walmart.com search results url

A tiny bit of experimentation (clicking in the URL in my browser and chopping off the &typeahead=pandemic portion) reveals that the following URL will also produce the exact same results:

https://www.walmart.com/search/?query=pandemic%20reign%20of%20cthulhu

Which means that all the components of a search are now visible. To unwrap it we have:

Search URL = https://www.walmart.com/search
Query field name = query

That’s it. We can now quickly turn this into a rudimentary HTML form:

<form method="GET" action="https://www.walmart.com/search">
  <input name="query" type="text" maxlength="40" />
  <input type="submit" />
</form>

Simple enough, right? You can see where the values we identified just drop into the code. The result? Here’s our search box, live and ready for you to test out:




Try it! Search for something!

Obviously, however, it’s ugly and rudimentary, so let’s give it a tiny bit of formatting and style:

<form method="GET" action="https://www.walmart.com/search">
   Search Walmart.com: <input name="query" type="text" maxlength="40" />
   <input type="submit" value="Go!" />
</form>

And the results:


Search Walmart.com:

So that’s it. Copy the above HTML code, go into the “text” or “raw” or “html” view in your page editor, paste it as shown, and boom! You now have a Walmart.com search box right on your Web page. Nicely done.

Pro Tip: I’ve been writing about HTML and Web page design for many years, including having written the book Creating Cool Web Pages with HTML, XHTML and CSS. I have a lot of HTML and CSS tutorials here on the site too, so please do check out my HTML help area for more ideas and assistance. Thanks!

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!

Leave a Reply Cancel reply

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

Search

Recent Posts

  • How to Check Energy Recommendations on your Windows Laptop
  • How Do I Customize New Tab Windows in Safari for Mac?
  • Can AI-Generated ChatGPT Text Be Accurately Identified?
  • How to Perform a Microsoft Account Security Audit and Checkup
  • How Can I Customize My Linux Dock / Taskbar?

On Our YouTube Channel

How to: Replace a Switchbot Door Sensor Battery

EMEET Luna vs INNOTRIK Studio Bluetooth Speakerphones -- DEMOS & REVIEW

Categories

  • AdSense, AdWords, and PPC Help (106)
  • Amazon, eBay, and Online Shopping Help (163)
  • Android Help (226)
  • Apple iPad Help (147)
  • Apple Watch Help (53)
  • Articles, Tutorials, and Reviews (346)
  • Auto Tech Help (15)
  • Business Advice (200)
  • ChromeOS Help (31)
  • Computer & Internet Basics (778)
  • d) None of the Above (166)
  • Facebook Help (383)
  • Google, Chrome & Gmail Help (188)
  • HTML & Web Page Design (247)
  • Instagram Help (49)
  • iPhone & iOS Help (623)
  • iPod & MP3 Player Help (173)
  • Kindle & Nook Help (99)
  • LinkedIn Help (88)
  • Linux Help (173)
  • Linux Shell Script Programming (89)
  • Mac & MacOS Help (911)
  • Most Popular (16)
  • Outlook & Office 365 Help (33)
  • PayPal Help (68)
  • Pinterest Help (54)
  • Reddit Help (19)
  • SEO & Marketing (82)
  • Spam, Scams & Security (95)
  • Trade Show News & Updates (23)
  • Twitter Help (220)
  • Video Game Tips (66)
  • Web Site Traffic Tips (62)
  • Windows PC Help (947)
  • Wordpress Help (206)
  • Writing and Publishing (72)
  • YouTube Help (47)
  • YouTube Video Reviews (159)
  • Zoom, Skype & Video Chat Help (62)

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."
© 2023 by Dave Taylor. "Ask Dave Taylor®" is a registered trademark of Intuitive Systems, LLC.
Privacy Policy - Terms and Conditions - Accessibility Policy