Incorporating "Search This Site" Functionality on a Web Site

With the addition of some CSS and javascript, you can enable users to search your website and find your Web pages/documents.

Here is a sample form using the OIT's website as an example:

<style>.gsc-tabsArea {display:none;}</style>
  (function() {
    var cx = '013791975455744583637:d-5gpo8xk5e';
    var gcse = document.createElement('script');
    gcse.type = 'text/javascript';
    gcse.async = true;
    gcse.src = '' + cx;
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(gcse, s);
<gcse:search as_sitesearch=""></gcse:search>

To make this form work for you, change "" to the url of your website. You can specify subdirectories.

When naming the website:

  • Do not include "http://"
  • Do not include trailing slashes (/)
  • Do not specify specific file names

Examples of valid specifications:


Examples of invalid specifications:

  • (includes "http://")
  • (includes a trailing slash)
  • (points to a specific file)

For more information about the campus-wide search engine, such as how it works, what it indexes, and how you can allow or disallow it to index your site, see the About The Campus-Wide Search Engine page.