Access Keys:
Skip to content (Access Key - 0)

Add the MIT Search Box to your site

On this page:

Google Search Appliance discontinued
Google has discontinued their enterprise Google Search Appliance (GSA) product and will not be renewing MIT’s license for our on-campus appliance. As of the end of June 2018, the Google Search Appliance will no longer be available to MIT web site owners for custom search. In its place, we recommend web site owners use the MIT Search Box ( for basic MIT-branded search, or a Google Custom Search Engine (CSE) if a more integrated experience is needed.

Add a Simple Search Box

You can add a search box to your website to help visitors find content on your site. You can restrict the search to a specified directory or search the entire MIT website. The search box will look and behave like this:

  1. Insert the following HTML into your web page where you want the search box to appear (parameters in bold can be customized):
    <div><form method="get" action="">
    <input type="text" name="q" size="32" maxlength="255" value=""/>
    <input type="submit" name="btnG" value="Search"/>
    <input type="hidden" name="site" value="mit"/>
    <input type="hidden" name="client" value="mit"/>
    <input type="hidden" name="output" value="xml_no_dtd"/>
    <input type="hidden" name="ie" value="UTF-8"/>
    <input type="hidden" name="as_dt" value="i"/>
    <input type="hidden" name="as_sitesearch" value="your_URL"/></div>
    An example of the your_URL format would be or Do not use a final slash on your URL.

  2. Customize the following parameters:
    • name="q" size="32"
      Sets the width (in number of characters) of the search box. You can change the size to suit your site's layout, but don't change the maxlength value.
    • name="btnG" value="Search"
      The text that appears on the search button. (e.g., "Search News Office")
    • name="as_sitesearch" value="your_URL"
      Searches will only include pages in the specified directory e.g., name="as_sitesearch" value=""
      • You must specify the complete canonical name of the host server followed by the path of the directory.
        E.g., not web/newsoffice
      • If the ("/") character is at the end of the web directory path specified, then only files within that directory will be searched and files in sub-directories will not be considered.
        E.g., to include sub-directories to exclude sub-directories
      • as_sitesearch allows you to specify one directory (and all its sub-directories) as the domain to be searched; you cannot specify multiple disparate directories using this option. If your site spans multiple sites or directories, consider setting up your own Google Custom Search Engine (CSE).
      • If you want the search feature on your site to search the entire MIT website, delete the as_sitesearch and as_dt parameters.

Related Links

IS&T Contributions

Documentation and information provided by IS&T staff members

Last Modified:

March 26, 2021

Get Help

Request help
from the Help Desk
Report a security incident
to the Security Team
crawlingschedule crawlingschedule Delete
google google Delete
indexpages indexpages Delete
m-hermes m-hermes Delete
search search Delete
webresources webresources Delete
c-web-publishing c-web-publishing Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
This product/service is:
Easy to use
Difficult to use

This article is:
Adaptavist Theme Builder (4.2.3) Powered by Atlassian Confluence 3.5.13, the Enterprise Wiki