How to Add Google Search to WordPress

Why should you add Google Search to WordPress? Although WordPress allows you to add a search feature, it doesn’t work very well. As a result, many website owners are looking for other ways to build search functionality for their sites.…

How to Add Google Search To WordPress

Why should you add Google Search to WordPress?

Although WordPress allows you to add a search feature, it doesn’t work very well. As a result, many website owners are looking for other ways to build search functionality for their sites. One of the most popular methods used by many website owners is to add a Google search to their WordPress site. With this method, you can limit the search to your own web pages. Besides, it is free, powerful, and reliable. Another highlight of using Google search is its amazing speed. If you don’t know exactly how to add Google Search to WordPress, today’s blog is for you. Let’s check it out now!

Methods to Add Google Search to WordPress

Using a plugin

We suggest using this method because it is easy and simple. With it, you can add Google search without customizing the theme files.

First of all, you need to install and activate WP Google Search by going to Plugins -> Add New. Then, find the plugin you need and click on Install Now -> Activate.

After that, let’s access Settings -> WP Google Search. Now, on the General Settings section, simply select the Display search box before search results and the Use default corrections CSS v2.

add google search to wordpress 1

Now, it’s time for you to open the Google Custom Search site and choose New search engine.

Next, enter your site’s URL in the Sites to search box, then select the language you need. After that, you just need to click the Create button to move on to the next step.

add google search to wordpress 2

Google will show you a notification confirming that you have successfully created a search engine.

Now, in the Modify your search engine section, let’s click on the Control Panel button.

add google search to wordpress 3

A control panel will appear for you to edit the search engine. The first thing you need to do is copy and save the Search engine ID.

add google search to wordpress 4

After that, on the left side of the screen, let’s choose the Look and feel option. In the layout tab, you simply need to select the Results only.

Don’t forget to Save all your settings after finishing.

add google search to wordpress 5

Now, let’s go back to your admin dashboard, then open Settings -> WP Google Search. In the box of Google Search Engine ID, you simply paste the ID you copied, then save all your settings.

add google search to wordpress 6

Once you are done, let’s access Appearance -> Widget. The WP Google Search widget will appear in the list of available widgets. Now, you just need to drag and drop this widget to the sidebar where you want to show the Google search form. After that, enter the title and save it.

add google search to wordpress 7

Now, you can visit your site to see the Google search form.

Inserting Google Search manually

With this solution, you have to edit your WordPress theme or child theme files.

Firstly, you need to back up your site with one of the WordPress Backup Plugins here. After that, let’s access the Google Custom Search site and select New Search Engine.

Now, you just need to fill out your site’s URL, choose the language, and click the Create button.

After that, you simply click on Get Code in the Add it to your site section.

add google search to wordpress 8

In the next step, you will see some code in a text area; copy it.

In order to continue the solution, you need to connect to your site via an FTP client. After that, let’s go to /wp-content/themes/your-current-theme/ folder. Replace your-current-theme with the folder name of your current theme.

Next, in the theme directory, let’s find the searchform.php file and download it. Then, simply open it with a plain text editor. Now, you need to delete all the contents of this file. After that, paste the code you got from Google Custom Search. Save this file, then upload it to your site via FTP.

Now, let’s access Appearance -> Widgets. It’s time for you to drag and drop the Search widget into the sidebar, then save it.

The Google search form is now ready on your site. Let’s check it out!

Editing the look of the Google search engine

If you want to change the default look of the Google search form, let’s open the Google Custom Search site. After that, on the left side of the screen, you simply choose the Look and Feel option.

The Google Custom Search will provide you with some premade themes to select and use. Besides, you can edit the font, background, border colors, and more.

Finally, don’t forget to save all your settings after finishing everything.

Wrap Up

In conclusion, we hope that today’s blog helps you add Google Search to your WordPress site easily. If you believe that the blog will be helpful for your friends, don’t hesitate to share it. Last but not least, we are providing a lot of Free WordPress Themes, so take a look if you want to give your site a new look.

Build it with a template

Start from a finished design: Joomla templates, WordPress themes or the AI-ready block themes. Every template has a free version and a live demo.

Free download

We'll send the link, setup tips and update notices, and you can reach us anytime through our AI assistant and contact form.

The download starts at once. We email you the link and ask you to confirm your address. Privacy policy.