Why should you add Google Search to WordPress?
Although WordPress allows you to add a search feature, it doesn’t really work. 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. By using this way, you can allow limiting the search to only your 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, the blog today is for you. Let’s check it out now!
The methods to Add Google Search To WordPress
Using a plugin
We suggest that you should use this method because it is easy and simple. By using this way, you are effectively able to add the 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.
Now, it’s time for you to open the Google Custom Search site and choose New search engine.
Next, let’s enter your site’s URL on the box of Sites to search, then select the language you need. After that, you just need to click on Create button to move on to the next step.
Google will show you a notification to ensure that you successfully generated a search engine.
Now, in the Modify your search engine section, let’s click on the Control Panel button.
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.
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.
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.
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 a sidebar you want to showcase the Google search form. After that, enter the title and save it.
Now, you can visit your site to explore the Google search form.
Inserting Google Seach manually
With this solution, you have to edit something in your WordPress theme or child theme files.
Firstly, you need to backup your site with the support of WordPress Backup Plugins here. After that, let’s access the Google Custom Search site, select New Search Engine.
Now, you just need to fill out your site’s URL, choose the language, and press on Create button.
After that, you simply click on Get Code in the Add it to your site section.
In the next step, there will be some code in a text area, so let’s copy the code.
In order to continue the solution, you need to connect your site via an FTP client. After that, let’s go to /wp-content/themes/your-current-theme/ folder. Now, let’s change the name of the current theme folder into the 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 contents of this file. After that, paste the code you have got from the Google custom search engine. Save this file, then upload it to your site by utilizing 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 ready on your site, let’s check it out!
Editing the looks of Google Search Engine
If you want to change the default form of Google Search Engine into a new one, 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 the blog today will help you add the Google Search to the 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 proving a lot of Free WordPress Themes, let’s take a look if you want to change your site interface into a new one.
The post How to Add Google Search To WordPress appeared first on LTHEME.
0 Commentaires