Do you want to use Google search on your WordPress blog? Although WordPress already has an integrated search function, we must admit that it is not very effective. This is why many site owners add Google Search to their WordPress blog.

In this tutorial, we will show you how to easily add Google Search to a WordPress blog.

Google Search on how to install WordPress

Why should you use Google Search on WordPress?

The default search function of WordPress is not very useful. It does not always make it possible to find the relevant results. This forces site owners to look for alternatives.

There are many search plugins on WordPress like SearchWP, Swiftype, etc. The problem is that you still have to think about managing them, and they will have an impact on your server resources.

Instead, you can use the reliable and powerful Google Search feature. It is free, allows you to limit the search on your site only, and can be run from your own blog.

Among the other benefits of using Google Search are speed, users already trust the Google search engine, and you don't have to worry about updating it.

That said, let's see how you can easily add Google search to your WordPress blog.

1 Method: How to Add Google Search with a WordPress Plugin

This first method is easier and recommended for beginners. It allows you to add Google search to your WordPress site without modifying your source codes.

The first thing you need to do is to install and activate the plugin WP Google Search.

After activation, you should visit the following location: " Settings> WP Google Search To configure the plugin.

WP Google Search plugin configuration

The plugin will ask you to provide a Google search engine identifier. Here's how you will get the search engine ID.

Visit Google Custom Search and click on New search engine link on the left.

WP Google Search search engine configuration

Then click on " Create a custom search engine ". You will access the interface where you will be asked to provide the URL of your website.

WP Google Search add a site to the search engine

You must then choose the language of the search engine. Once everything is done, all you need to do now is click on the " Create Â».

WP Google Search Google Setup Window

Then click on " Control panel On the new window, click on " Search engine ID ", And a window will appear with the code of your search engine, and this code will be used later.

WP Google Search Retrieving the Search Engine ID

What you can do besides is to customize the appearance of the search engine.

WP Google Search engine interface

Once you're done, click the Save button at the bottom of the page to store your changes.

Now you can go back to your WordPress site. Paste the search engine ID that you copied earlier into the WP Google Search plugin settings page and then click the Save changes button to store the plugin settings.

After that, you must visit the following page " Appearance> Widgets ". You will notice a widget WP Google In the list of available widgets. Drag and drop the widget on one of your sidebars.

GCSE widget to add a search engine on WordPress

Click the Save button to save your widget settings.

You can now visit your site to see the action search form.

2 Method: Manually Adding Google Search to WordPress

This method requires making changes to your WordPress theme or child theme files. It is not recommended for beginners. Be sure to back up your WordPress site before making these changes.

Visit the Google Custom Search site and click on " New search engine Â».

New Google search engine

On the next step you have to click on " Get Code To retrieve the code from your search engine.

How to recover the code of a search engine

Once you have the code, access your accommodation via an FTP client, then locate the file “ searchform.php ". Delete all the code from this file and add your search engine. Save your file and access the widget interface.

From this interface, add the WordPress search widget on one of your sidebars.

WP Google Search add the widget to the sidebar

That's it for this tutorial. I hope that now you can add Google search form to your WordPress blog. Do not hesitate to contact us if you encounter areas of darkness.