---
title: How to Add Simple Google Site Search to Any Website
date: 2011-02-17T09:12:36+00:00
modified: 2012-06-26T14:58:09+00:00
permalink: https://kaspars.net/blog/how-to-add-google-site-search
post_type: post
author:
  name: Kaspars
  avatar: https://reverse.kaspars.net/gravatar/avatar/92bfcd3a8c3a21a033a6484d32c25a40b113ec6891f674336081513d5c98ef76?s=96&d=mm&r=g
category:
  - Development
  - WordPress
post_tag:
  - How to
  - HTML
---

# How to Add Simple Google Site Search to Any Website

Built-in search engines of WordPress, Drupal and other content management systems are good, but not as good as Google. Here is a simple way to create a Google search form that will return results only from your site:

```
<form name="google-search" method="get" action="http://www.google.com/search">
	<input type="hidden" name="sitesearch" value="http://yourdomain.com/" />
	<input name="q" type="text" />
	<input type="submit" name="sa" value="Google" />
</form>
```

which will look like this:

 This form does redirect your visitors to Google, but the results returned are only from your site, so there is nothing to worry about. And with Googling indexing blogs almost instantly, there are actually very little drawbacks from using this approach for site search.