How to create a search for your web page or blog

Updated: 12/30/2019 by Computer Hope
Search icon
Tip

Consider creating a Google Custom Search Engine for more options and features.

Today, many of the large search engines allow you to use their index to create a customized search for your page. For example, you can add a Google search bar to your web page that only searches the pages on your site using the code below.

<!-- SiteSearch Google -->
<form method="GET" action="https://www.google.com/webhp">
<input type="hidden" name="ie" value="UTF-8">
<input type="hidden" name="oe" value="UTF-8">
<table bgcolor="#FFFFFF"><tr><td>
<a href="https://www.google.com/"><img src="https://www.google.com/logos/Logo_40wht.gif" border="0" alt="Google logo"></a>
</td>
<td>
<input type="text" name="q" size="31" maxlength="255" value="">
<input type="submit" name="btnG" value="Google Search">
<input type="hidden" name="domains" value="Computer Hope"><br><input type="radio" name="sitesearch" value=""> WWW <input type="radio" name="sitesearch" value="computerhope.com" checked> Computer Hope <br>
</td></tr></table>
</form>
<!-- SiteSearch Google -->

Changing the computerhope.com and Computer Hope references to your domain and website allows you to use Google to search your site. Additional information and terms of service of the Sitelink Searchbox is in the Google Developers document.

Example

The following example is a Google Sitelink Searchbox. Users that type a query in the box are redirected to Google, and can optionally get results for your website only.

Google logo
WWW Computer Hope