If you would like to add Google search to WordPress, there are 3 methods listed below. Having a good search engine on your WordPress site, helps users find content much faster. Unfortunately, the default WordPress search is not good. Let’s get started.
Add Google search to WordPress using these 3 methods-
Using Google custom search
- Go to https://cse.google.com/
- Enter your wordpress website URL under sites to search.
- Create a custom search engine.
- Go to setup-> Code and copy the code.
- In your wordpress site, access the searchform.php file, delete its contents and add the google custom search code there and save the file.
- Go to Appearance->Widgets from your Admin Dashboard. Add the Search widget to your wordpress sidebar.
Using WordPress plugin
- Install and activate the WP Google Search plugin.
- Create a google custom search engine and copy-paste the search engine id (cx id) into the plugin settings.
- Use WP Google Search widget or [wp_google_searchbox] shortcode to place search box on your site.
Using the WP Fastest site search plugin
One of the major drawbacks of Google custom search is that it contains ads. The WP fastest site search plugin adds a Google-like search engine to your WordPress site.
- Install and activate the WP fastest site search plugin.
- Go to WP fastest site search, sign up, enter your website URL and intital website crawl.
- Copy-paste your API Key into the plugin settings.
- If the above methods don’t work, copy the search engine code from here.
- Now copy-paste this code into your searchform.php file.
- Take live WordPress google search.