How to Add Search Function to A Blog?


As I don’t want to place the search code at every single page of this blog, I decide to put all search features within a customize page.

Search via Google.com (Recommended)

The code can be purely done in simple HTML – Search Code.


Let the Giant Search Engine take over the load; this method does not impact your server performance and normally provides quite good results (however, it takes time for Google to index your blog).

Inbuilt WordPress Search Function

Replace the above code with the target URL in the form of /?s=key+to+search.


The code is also very simple, which can be done in pure HTML code:

1
2
3
<form action='https://helloacm.com/' method='GET'>
<input name='s' id='s'/><input type='submit' value='Search via WP'/>
</form>
<form action='https://helloacm.com/' method='GET'>
<input name='s' id='s'/><input type='submit' value='Search via WP'/>
</form>

However, it can be internally replaced by other search engines. The advantage of such method is that WP provides instant updates on your latest posts but on the other hand, it consumes your server’s resources, and you might want to cache the search results.

search-engine-girl- How to Add Search Function to A Blog? Google HTML search tools / utilities

search-engine-girl-

–EOF (The Ultimate Computing & Technology Blog) —

GD Star Rating
loading...
360 words
Last Post: What is the Probability of Two Sharing Birthday?
Next Post: How to Capture the Integer-Divide-By-Zero Error in C++?

The Permanent URL is: How to Add Search Function to A Blog?

Leave a Reply