If you run large WordPress website, then you could consider changing the default WordPress search engine to something more robust like one by Google – if that is the case, then you need to know how to add Google custom search to WordPress.
The default WordPress search functionality is okay for a small website, but, if your blog has thousands or even several hundreds of varied content, then you will need to leverage on the power of Google search engine.
Why You Need to Add Google Custom Search?
First, it improves the performance of your website by moving the load of search queries to Google.
Second, Google delivers better and relevant search results that the custom WordPress search engine. Users can search for both text and images. Additionally, if you have multiple websites, you can configure it to query these other websites.
Third, for a blogger looking for an additional income stream, you can make money off AdSense ads displayed along your search results.
If that is something worth considering, then, here is how to add Google custom search to a WordPress website.
Step 1: Create a Google Custom Search Engine
- Go to https://cse.google.com/cse/ the Google Custom Site website and create a Custom Search Engine.
- Enter your domain name, select the language of your site, give your search engine a name, and click the Create
- You are taken to a congratulatory page, where you should click Control Panel.
From the control panel you can modify the custom search engine to your preferences; you can explore these later once the custom search engine is running.
For now, all you need is the Search Engine ID. Copy it; we shall use it in step two.
Once you have the Google Search Engine ID, you can configure your website.
For this article, we shall use a free WordPress plugin – WP Google Search – to simplify the task so you do not have to touch any code.
Step 2: Install and configure WP Google Search
- Log in to your WordPress admin panel to install and activate WP Google Search plugin.
Go to Plugins then click Add New.
Enter WP Google Search in the search box. When the results populate, scroll down till you see WP Google Search.
Click the Install Now button to install it. Then, Activate it.
- Configure WP Google Search
To configure the custom search, go to Settings, then to WP Google Search
Copy the Google Search Engine ID from step one and paste it to the provided field.
There are a couple of other settings you can opt for within the same page, but, once you are done, Click Save Changes.
Once you save the changes, you can access the default custom search page on the path https://yoursite.com/search_gcse/
The next step will show you how to add or display the search form on any sidebar on your website.
- Display the Google Custom Search form on the website
To display the custom search engine on your website, head to Appearance and click Widgets
Look for WP Google Search (WGS), select the sidebar you want to display the custom search widget and click Add Widget.
That’s it.
If all went without a hiccup, then you have been able to add Google custom search to WordPress successfully.
Now, go to your website and verify that everything is working well.
Of course, you will need to remove the other search forms on your website, like I have to on mine.
Conclusion
Using a plugin is the easiest way you can add Google custom search to a WordPress website.
It is as simple as:
- Creating a Google Custom Search Engine to get the Search Engine ID.
- Installing, activating, and configuring a plugin like WP Google Search
That is something any website owner – of any and every skill level – can do, without touching a single line of code. Unless, if they want to add the Google Custom Search Engine manually. If you go this route though, do not forget to backup your website before tampering with the files.
Whichever way you go about it, the benefits a large website can get by using Google for its search functionality are worth every effort.
Please share with us your views and feedback in the comments section below.
Hopefully you have found this read helpful. You may also want to add your WordPress website to Google Search Console.