How to Create a Self-hosted Google Custom Search Engine For Your Blog

I have just implemented the Google Custom Search Engine here on PinoyTech. Hopefully, it would be better than Wordpress’ built-in search function.

For those who are still not familiar with it, here’s a screenshot of a self-hosted Google Custom Search Engine.

Google custom search engine on PinoyTech

What is a Google Custom Search Engine?

It’s a search engine using Google’s search technology you can integrate into your websites and blogs. According to Google, A Custom Search Engine can:

  • Apply your website’s look and feel to the search results page.
  • Provide search refinements within results pages to make it easier for searchers to find the information they’re looking for.
  • Add sites to your search engine’s index as you surf the web.
  • Invite friends and trusted users to co-edit and contribute to your search engine.

I have created a step by step tutorial on how to integrate Google Custom Search Engine to your blog.

Custom Search Engine Creation

custom search engine startFirst of all you must be signed in to your Google account. If you do not have a Google account, you’re missing a lot. I suggest you sign up here.

Visit the Google Custom Search home page and click the “Create a Custom Search Engine” button to start.

Basic Information

Fill up the search engine name field with whatever name you want to call your search engine. I called mine PinoyTech Search Engine. Next you need to fill up the the search engine description.
custom search engine basic information

Type in keywords that best describes the content that you will be searching. Choose your language and click, “Only site I select”
custom search engine basic information

With Google Custom Search Engine, you can choose what websites or web pages should be searched. Here’s a short list of possible entries.

  • Individual pages - Allows you to search a single page ( pinoytech.org/teejay.html)
  • Entire sites - Allows you to search a whole website ( pinoytech.org/*)
  • Parts of sites - Allows you to search only pages with URLs that contain a certain word.
    For example: “magnolia” ( pinoytech.org/*magnolia*)
  • Entire domains - Allows you to search entire domains ( *.pinoytech.org).
    Note: Using only, “pinoytech.org” will be automatically converted to *.pinoytech.org/*

custom search engine basic information

Agree to the terms and conditions (Yes. I am truly sorry but you need to accept the terms and conditions) and press “Next”. The next page should show you a preview of your new search engine. Once satisfied with your new search engine, press “Finish”.

Blog Integration

Create a page on your blog. This will serve as the page wherein your search results will show. Remember to take note of the page slug because we will need it later on.
Search Engine Page

Now go to the control panel of your custom search engine, you can find the code to be used for your search engine. Click on “iframe”.
Search Engine Code

Type in the page slug of the page you created for your search results. Then copy and paste the search results code in the code view of your page.
Search Engine Code
Search Engine Page
Lastly, you need to copy and paste the Search box code on your header.php or sidebar.php to show your search engine input box.
Search Engine search box

That’s it. You have created your own self-hosted custom search engine.

What’s Next?

Do you know that you can integrate your Google Adsense ads into the Google Custom Search Engine? Unfortunately, this post is already very long. Another tutorial will be posted for Google Adsense and Google Custom Search Engine integration.

For now, enjoy using the Google Custom Search Engine. Hopefully, I’d see more and more people using it.

Post a Comment

Your email is never published nor shared. Required fields are marked *