Search Results "Sort By Date" Order in Blogspot

Updated on: July 20, 2016
How to set Sort by date as default sorting order in blogger
How to set default order for search result

We have already discussed that Search is the necessary part of the blog/blogspot and whenever your users make search over it the resultant page shows results sorted by relevance for the give query for example:

Showing posts sorted by relevance for query sample. Sort by date Show all posts

Many of you want to change the order and would like to set "Sort By Date" as the default sorting order not "Sort by Relevance" so that your viewers can see your latest posts first without clicking on link each time to change the order. This method works only with 3rd party search boxes. Follow the given steps carefully.

How To Set "Sort By Date" As Default Sorting Order

Step 1. Login to your Blogger account, then navigate to your 3rd party Search Box code.

For example:

<form action="/search" method="get">
<input type="text" name="q" placeholder="Type Here..."/>
<input type="hidden" name="max-results" value="8"/>
<input type="submit" value="Search" />
</form>

Note: The above code may vary.

Step 2. Find the code </form> and paste the following code just above it.

<input name="by-date" type="hidden" value="true"/>

For Example:

<form action="/search" method="get">
<input type="text" name="q" placeholder="Type Here..."/>
<input type="hidden" name="max-results" value="8"/>
<input type="submit" value="Search" />
<input name="by-date" type="hidden" value="true"/>
</form>

Step 3. Save your code.

Read: How to Change Status message on search result page

Enjoy!

Jump into your blog and make a search. Wait! What? your search result is sorted by date not by relevance. Remember code may vary according to your search box, if the above tutorial doesn't work for you don't worry - comment below. Stay Updated, Browse Howbloggerz ! :)

Post a Comment

أحدث أقدم