Adding Google Custom Search Engine to WordPress 1


Google promotes it’s services in subtle ways. After integrating some Google services, like Adsense into my webpage it was time for Google Site Search.  Search is not really used much on my webpage, but it does not take really long to integrate it.  Google Custom Search can be configured in a multitude of ways. As I do not have a lot of content yet and I wanted to be quickly done with it, I used almost defaults again. On Custom Site Search page I chose layout named ‘Two Page’. What it means is that I can add search box as text widget on my web page and search results are shown on a different page on my website.  Adding a text widget and filling it with HTML supplied by Google is simple. Then a page needs to be added where search results are shown. I did use a different post template for it. How it can be achieved is described in WordPress and AdSense implementation. I could have used a simple post and it’s HTML editing mode but the search results HTML is a bit complicated and WordPress HTML editing mode keeps mangling it up. Easier is to use an empty post and add all relevant code into post template. For now I have one search box for the whole site, but I might implement different search boxes for different sections using custom sidebars. If this site search sees some more usage first.


Leave a comment

Your email address will not be published. Required fields are marked *

One thought on “Adding Google Custom Search Engine to WordPress