How to Add Google Custom Search to WordPress Site

In this tutorial, I’m going to show you how to create a custom Google search engine that you can embed on your own website and how you can earn money from it. Google custom search engine allows you to decide what site will be searched when terms are entered in the search box.

Start by going to https://cse.google.com/cse/. cse stands for custom search engine. Sign in with your Google account and then click Create a custom search engineSelection_003

In the next page, put the sites you want your site visitors to search in the Sites to search field. You can enter multiple domains. Enter as many as you like.

Selection_004

Then scroll down. select a language and give the search engine a name. When you’re done, hit the CREATE button.

Selection_005

Now your custom search engine is created.

Selection_006

You have three options: Get code, Public URL and Control Panel. In order to embed Google custom search in WordPress, we need to get code. But before we do that, we can customize the look and feel of the search engine and many other settings in control panel. So hit Control Panel button.

In the control panel there are 5 menus on the left. Each menu has its own tabs. Click Look and feel menu, you can customize the layout, themes, font, color and include thumbnails in search results.

Selection_009

At the bottom of each tab there’re two buttons. Once you have finished customization, click Save & Get Code.

Selection_010

You will get a code like below.

Selection_011

What you need to do is go to your WordPress dashboard. Select Appearance > Widgets.  Drag a text widget to the sidebar area or whatever area you like. Copy and paste the above code into the text widget and save it. Refresh you website and Google custom search will be displayed on you website.

Enable Google Custom Search Engine monetization

By default Googles ads will be displayed when visitors search your site using Google custom search. If you have an adsense account, then you can enable monetization so when visitors click on those ads you will get paid.

In the Setup menu, click on Make money tab. Be default Search Engine Monetization is off. We need to toggle it so it reads on.

Selection_008

A message “The account is associated with Adsense id: partner-pub-xxxxxxxxx” will be displayed. Now you have succesfully enabled monetization, you can set what ads should be displayed in custom search in your adsense account.

Rate this tutorial
[Total: 0 Average: 0]

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • Please use the community (https://community.linuxbabe.com) for questions unrelated to this article.
  • I don't have time to answer every question. Making a donation would incentivize me to spend more time answering questions.

The maximum upload file size: 2 MB. You can upload: image. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here