How to Create a Google Custom Search Engine in a Joomla Site

This tutorial will show you step by step how to create a Google custom search engine for your Joomla site (and/or another site) in your Joomla site. This tutorial uses Joomla 1.5 but you can use exactly the same steps on Joomla 1.6.

Download

tutuploadstutuploadsmedia_1300927421098.png

We are going to be using an excellent Joomla extension called googleSearch (CSE) component . Click here to go directly to the download page.

Download the extension of your respective Joomla version.

Install

tutuploadstutuploadsmedia_1300927568232.png

Go to Extensions >> Install/Uninstall >> Browse... >> Upload File & Install

Set Up Custom Search Engine in Google

tutuploadstutuploadsmedia_1300928179019.png
tutuploadstutuploadsmedia_1300928492465.png

The first step (1. Setup up your search engine) is self-explanatory. Configure appropriately.

The only tricky part is the syntax for the "Sites to search". In the example, I have it so that only results from www.ostraining.com and www.joomlatraining.com show up in the search.

Formatting your URLs

  • Individual pages: Specifying www.mysite.com/mypage.html will just include the mypage.html page on www.mysite.com.
  • Entire sites: Specifying www.mysite.com/* will include all the pages on www.mysite.com.
  • Parts of sites: You can use wildcard patterns to include just certain parts of a site. For example, www.mysite.com/*about* will include only files on www.mysite.com that have about in their name.
  • Entire domains: You can also specify an entire domain using *.mydomain.com. If you specify mydomain.com, we will automatically convert this to *.mydomain.com/*. If this is not what you want, you can change it back in the control panel.

Click Next when finished.

tutuploadstutuploadsmedia_1300929074983.png

In the second step (2. Try it out) we only have to test the search engine to see if we correctly configured the URLs in step 1. There is no need to customize because we will do that in the Joomla administrator.

In the example screenshot above, I tested with the keywords "Joomla Training". The results only bring up results from www.ostraining.com and www.joomlatraining.com, which is what I wanted.

Test the search. If the results are not what you wanted, go back to step 1.

Click Next when finished.

Get the Custom Search Engine's unique identifier

tutuploadstutuploadsmedia_1300929663910.png

The last thing we need is the Custom Search Engine's unique identifier. The easiest and less confusing approach for most people is to copy it from the control panel. Click here to go to the management area. Click on Control Panel.

tutuploadstutuploadsmedia_1300929781979.png

Copy the unique ID.

Configure Joomla Component

tutuploadstutuploadsmedia_1300927955312.png

Go to Components >> googleSearch (CSE)

tutuploadstutuploadsmedia_1300929910683.png

Paste the ID in the Custom Search Engine's unique identifier field.

The custom the rest according to your preferences.

tutuploadstutuploadsmedia_1300930006628.png

Save.

Create the Menu Item

tutuploadstutuploadsmedia_1300930183904.png

Finally we need to create the menu item. Go to Menus >> Your menu

tutuploadstutuploadsmedia_1300930401211.png

Click on New.

tutuploadstutuploadsmedia_1300930492204.png

Click on googleSearch (CSE)

tutuploadstutuploadsmedia_1300930594451.png

Configure appropriately. Give it at least a Title and then Save.

Test

tutuploadstutuploadsmedia_1300931293159.png

Go to the menu item in the front end and test your search.