...

Add Google custom search API to your WordPress search

5. Create Search Results Page

Let’s create a page for the search results. In your WordPress admin dashboard. In the left sub-menu tab. Go to ‘Pages’, expand it and click ‘Add New’.

Step 1

Give your page a title. We’re going to name it ‘Search’. If you name it into something else, you will end up with a ‘404 Page Not Found’ error page. Remember I told you to add the word ‘search’ after your blog URL?.

Example: That’s the whole point, to match your URL permalink with form action request inside your WordPress searchbox codes.

Step 2

Before adding the search-results codes to your page. It’s really important for you to click the ‘HTML’ tab on the right next to ‘Visual’ tab. Step 3 After that you can paste the search results code in the textarea.

Note: WordPress visual editor have the bad habit of messing up any type of raw codes written inside the textarea. Refer to image below for Step 1 – 3. Step 1-3 Step 4

Just under the textarea, you will see a menu bar titled ‘Discussion’. You need to disable the comments, trackbacks and pingbacks feature by uncheck the radio button. You don’t need it anyway. Step 5

Next, on the right sidebar. Look for menu titled ‘Page Attributes’, in the sub-menu you will see a title ‘Template’, under that select input click and highlight ‘No Sidebar’. That’s the php template we created earlier. Step 6 Still on the right sidebar area, Look for menu titled ‘Exclude Pages’. This menu will appear if you have activated the plugin. Uncheck the radio button to hide/exclude the search results page from list of pages and from your blog navigation menu bar. You can find this page by typing manually the URL ) in your browser. Step 7

Lastly, ‘Publish’ your page. Exit your admin dashboard and go to your blog front page. Test it by searching your blog using the searchbox. If you followed everything I have instructed you correctly, you will see a list of actual Google search results showing on that page.

Conclusion

That’s conclude my tutorial on how to add Google custom search engine to your WordPress and replacing the default search functions. It’s still works the same as your WordPress standard search capabilities and it doesn’t redirect the search results away from your blog. Giving you the feel as if the Google custom search engine is a standard part of WordPress itself. If you have any questions or comments regarding the tutorial.

Please use the comment box. I’m all ears and open for discussions and suggestions.

Leave a Reply

Your email address will not be published. Required fields are marked *

Next Post

Most Successful Startups in 2015

Mon Apr 30 , 2012
Cras sit amet libero eros, in ultricies lorem. Nunc et odio neque. Maecenas vehicula interdum hendrerit. Integer hendrerit orci ullamcorper neque pellentesque feugiat. Aliquam magna metus, fringilla non ultrices id, fringilla eu erat. Phasellus lorem tortor, porttitor volutpat iaculis sed, condimentum ultricies massa. Curabitur ut malesuada elit. Nullam tortor mi, […]
photodune  group of business people working on an office desk s

Related

Seraphinite AcceleratorOptimized by Seraphinite Accelerator
Turns on site high speed to be attractive for people and search engines.