What’s up my gangsters? In this tutorial I’m gonna show you how to add a custom google search on your website. Custom google search is popularly known as CSE (Custom Search Engine) which shows the search results only from your site.

custom google search

Purpose of Custom Search Engine

The main purpose of a Custom google search is to get more clicks for your website links, which helps to increase your site’s page rank.

You can monetize your site search by showing google adsense ads on the search results page.

Steps to Add

First visit https://www.google.com/cse/

Make sure that you’ve logged in with your google account.

Click on Create a custom search engine button


Enter your website details such as website link, title, language etc…

Click Create button


Now you will be redirected to another page.

Click Get code button and copy the code.


Now add that code to your web page wherever you want (inside of body tag).


 <title>void Tricks</title>
 <div id="sidebar">
 <!-- Custom Search Code-->
 (function() {
 var cx = '008600000000000:da9e4um-cn4';
 var gcse = document.createElement('script');
 gcse.type = 'text/javascript';
 gcse.async = true;
 gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
 '//www.google.com/cse/cse.js?cx=' + cx;
 var s = document.getElementsByTagName('script')[0];
 s.parentNode.insertBefore(gcse, s);
 <!-- Custom Search Code end -->

In case you want to customize the appearance or want to edit setup, Go to your CSE panel https://www.google.com/cse/all

Click on the CSE Title you just created.

On the left sidebar you will find a menu called Setup, Click that.

You can edit the setup and save and copy the code and replace it on your page.

custom search engine

If you want to change the appearance and layout, select the menu Look and feel

Change the options as per your wish. But I would recommend you to stick with the default.

custom search engine layout

And yeah, that’s it for the tutorial.


Keep scrolled with us for more updates


Anand Roshan

Author: Anand Roshan

An entrepreneur, programmer and a passionate artist who loves to work independently. Get social: Twitter | Google + | Artist Page

Leave a Reply

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