Hello, guys, Adding Google custom search widget in WordPress site can improve your blog search page. Previous i have already published How To Create Google Custom Search Engine For Your Blog (Step By Step Guide). If you are not sure how you can create custom google search code for your blog. go to this link and create your first google custom search.
After creating Google Custom Search, You have to add to your WordPress site. Here in this post, i’m going to show you step by step guide to add Google custom search in WordPress.
Add Google Custom Search Widget in WordPress
Please follow the guide carefully and you will be able to add custom google search code into WordPress site.
- First Go to WordPress Dashboard and then Appearance » Editor
- Now click on
searchform.phpfile to open it in the editor.
- Paste the Google custom search engine code in the file. It is alright if this file does not contain anything else and just the Google custom search engine code.
If your theme does not have a
searchform.php file, then you need to create one using a text editor like Notepad and upload it to your theme directory using FTP client.
- After pasting Google custom search code, go to Appearance » Widgets and Drag WordPress Search Widget into your sidebar.
That’s all, preview your site to see it in action. You don’t need to use any Google Search Engine Plugin for WordPress.
Note: Some premium themes have different codes so, If you are using a premium theme and don’t have searchform.php file then you have to ask for support From theme developer.
Or you can simply add text widget in the sidebar and paste google custom search code. And save the file.
Customize Google Custom Search Engine Colors and Looks
If you want a new look and feel for your custom google search then you need to learn from here and change the look and feel on custom Google search page. Google custom search has some premade themes available to choose from. You can also click on customize tab and choose your own font, border, background colors. Once you are done customizing the looks of the search box, simply save and your changes will appear on your site.
You do not need to change the code on your site. The changes will appear automatically.