Add a Google Custom Search to Your WordPress Site

adding-google-search-wp

WordPress is a great platform in many ways. Search is not one of them. You can use different plugins to fix this problem, but you’re going to need a LOT of plugins. It would be much easier to just add Google Custom Search onto your site. So what are you waiting for? Let’s do it.

Create a Google Custom Search for Your Site

First up, you need to create the search engine. For that, you need to visit Google’s Custom Search Engine site and sign in with a Google account. The click on Create a custom search engine and input your site’s URL. Click the Create button to continue.

Custom Search Create CSE

On the next page, you’ll see a notification that you’ve successfully created a search engine. Choose the Get Code option. Copy the code that shows up on the next page.

Custom Search Congratulations

Adding the Custom Search Engine to WordPress

Go to Appearance>Editor and click on the searchform.php file to open the editor. Paste the custom search engine code in the file.

If your theme doesn’t have this file, then you’ll need to create it on a text editor and upload it through a FTP.

After doing this, go to Appearance>Widgets to drag and drop the search engine into your sidebar.

searchwidget

That’s it if you just want to add that, but I’m sure you want to customize it.

Customizing the Search Engine’s Look

Go back to the Google Custom Search Engine website and click on your search engine. Click Look and Feel in the sidebar.

CSE Look and Feel Layout

Google includes a few permade layouts and themes, but you can customize the look in the Customize tab. When you’re done, just save it and the changes will appear on your site.

Source: (wpbeginner.com)