Tutorials, WordPress

How to Create a Google Search Box for WordPress Blog

Search box or search forms are important for every blog out there. Your visitor may land on your blog from a search engine result page, an external site which has outbound link to your site, or simply a referral of their friends. Either way, they may be looking for something else. Most people would prefer to try searching on your site instead of going back to Google and searching again. However, wouldn’t it be great if they see a Google Search box right in your site? Aren’t they more likely to search using that form instead of going back to Google.com?

You bet the answer is positive. If your blog is well-indexed, you may be wondering what is the difference if they go to Google.com and search for some other topic. There are obvious differences. First of all, Google may not show results from your blog in that second query. Secondly, even if Google does, chances are you will not be in the first page. That’s why you need to have Google Custom search box right on your site. This way, Google will show only the results coming from your blog.

In this tutorial, we’ll show you how to add a custom Google search form instead of the default one that comes with every wordpress installation. Follow along and in minutes you’ll have your custom Google search set up.


First you need to register your URL with Google Custom search. Go to Google Custom Search page and click Create a Custom Search blue box to get started.

On the next page, you’ll see the form to enter basic information about your custom search engine.


In this step, you will require to give your custom search engine a name and an optional description. By default the language will be set to English. If your blog is written in English language, you don’t need to change that. In the second section called Define your search engine, you’ll need to enter the URL/link/address of your blog. Write it in one line. If you have multiple websites/blogs, you can enter each of them in separate lines. Once done, make sure you have the Standard Edition radio button selected. Then check the Terms of Service agreement box and click Next to continue to the next step.

Now you’re at the second step of installing your custom search engine. Here you can change the look of your search box. If you’re still not sure how this is going to work, simply type in a query in the search box and click the search button. You’ll see results in seconds. If you want to change the outlook of your search box in your own way, you can do that simply by clicking the customize button below each default styles.

Once you’re satisfied with the result, scroll down to the bottom of the page and click the Next button to get your code.

Get the Code

In this last step, you’ll be given the final code that needs to be placed on your blog. You should copy-paste the code to your blog. Note that the search form will appear wherever the code is pasted. To show the searchbox on your sidebar, simply create a new text widget, paste the code and save it.

If you change your mind later to do some tweaking to your form, you can always do so from the control panel of your custom Google search engine. Just below the code you’ll see another section titled Next Steps. From there you can tweak the settings or even make money out of your search box!

This is how the control panel looks once you enter it after the custom search engine has been created.

Control Later

As you can see from the control panel you can edit the basic settings of your custom search engine, add more sites, change the look and feel of the form, add Google Analytics, get the code again in case you lost it and lots more. We hope this has been easy for you to follow along this tutorial.

Although WordPress’ default search box is as powerful as it could be, adding Google Search box instead of the default one convinces your readers to search using that form. You know that the Google logo counts wherever it is!