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 engine.
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.
Then scroll down. select a language and give the search engine a name. When you’re done, hit the CREATE button.
Now your custom search engine is created.
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.
At the bottom of each tab there’re two buttons. Once you have finished customization, click Save & Get Code.
You will get a code like below.
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.
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.