![]() |
Adding Google Search to a WordPress site can enhance SEO ranking and improve the overall user experience. Google offers a framework, Google Programmable Search Engine, which simplifies the process of integrating a search bar into a WordPress site.
Steps to Add Google Search to a WordPress SiteTable of Content
Step 1: Open Programmable Search EngineThe first step is to go to the website of the Google programmable search engine, go Google and type programmable search engine, and open the website, google gives a code-specific csx ID that can be copied and used on any website to add the search engine to the page. ![]() Open Programmable Search Engine. Step 2: Enter Website DetailsEnter the details for your website:
![]() Enter Website Details. Step 3: Create the Custom Search EngineAfter creating the search engine, configure additional settings:
Complete the CAPTCHA and click on “Create”. ![]() Create the Custom Search Engine. Step 4: Copy Search Engine CodeOnce the create button is clicked, it will redirect to a new page where it will say that the search engine is created now simply copy the code by clicking on the copy button and paste it by following further steps. ![]() Copy CSX ID. Step 5: Open WordPress Dashboard & Add PluginFor pasting the code we will have to install a plugin that can easily paste the code inside the body tag of the website, for this first visit the admin panel of the website by visiting the following URL (replace yourwebsitename.com with the name and domain extension of your website.) https://yourwebsitename.com/wp-admin
After this, click on the plugins tab from the left side and select the “Add new plugin” option, as seen in the image below: ![]() Open WordPress Dashboard & Add Plugin. Step 6: Install WPCode PluginOnce the above steps are completed, a search button is shown in the middle right corner of the window, from here search for a plugin called “WPCode” which can help to create and insert code snippets inside the WordPress body tag. Click on the Install Now button to install the WPCode plugin on the website. ![]() Install the WPCode Plugin. Step 7: Click on Add SnippetsOnce the plugin is installed, a new option called Add Snippets will appear inside the plugins tab on the lower left side, click on that Add Snippets button and move to the next step. ![]() Click on Add Snippets. Step 8: Click on Add Custom SnippetsAfter the above steps, there will be several different options available, click on the first option that says add your custom code, this will allow you to add custom code and it will be automatically pasted in the body of every page in the WordPress, as you can see in the image below: ![]() Click on Add Custom Snippets. Step 9: Paste Custom Search CodeOnce the snippet is opened, it will ask for only two details, first is the name of the code snippet and the code that needs to be pasted, in the name anything can be written such as Google search, etc. and in the code preview the code needs to be pasted which was copied previously from the google’s programmable custom search engine. ![]() Paste Custom Search Code. Step 10: Test the Search EngineOnce all of the steps are completed successfully, reload the website and a Google search engine will appear on the site, it will look similar to the one below: ![]() Test the Search Engine. Type any query related to the website such are the website name, article name, etc. and it will run a Google search within the website as seen in the image below: ![]() Test the Search Engine. ConclusionGoogle search can be implemented in the WordPress site easily as Google offers a tool called Google Programmable Custom search which helps to create a custom ode and add the code inside any WordPress site using either the manual process of adding the code inside the body of the code or simply use a plugin which can paste the code in the body tag of the WordPress site. |
Reffered: https://www.geeksforgeeks.org
Web Technologies |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 17 |