Adding Google Search In Your WordPress Blog
When it comes to search, WordPress drastically lacked the space although there are plugins available out there which may helps the one to improve search results. But for those who don’t want to add additional plugin for the purpose as well as increase the functionality, there is one such big option available out there. One can consider on replacing their by default WordPress search with Google custom search.
Suggested Reading: Five Best Search Plugins For WordPress
Creating a Google Custom Search Engine
- Go to Google Custom Search Engine and sign in using a Google account.
- Once in, then click on New Search Engine and add your WordPress website’s URL.
- Click on Create button to proceed to the next step.
- Once done, you will notice a notification which says you have successfully created your custom search engine.
- An option then will comes in front of you either to add it to your site or get the public URL.
- To add this to your WordPress site, click on the Get Code button.
Adding In Your WordPress Blog
- Go to Appearance » Editor in your WordPress admin area and click on searchform.php file.
- The searchform.php file will open it in the editor.
- Paste the custom search engine code in the file.
- If your theme does not have a searchform.php file, then you need to create one using a text editor like Notepad.
- Once created, upload it to your theme directory using FTP client.
- Once code is pasted at its right place, go to Appearance » Widgets to drag and drop the search widget into your sidebar.
Photo Credit: Flickr/karlnorling