Search Results "Sort By Date" Order In Blogspot

December 27, 2020
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:

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.

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 Tech2site ! :)

Artikel Terkait

Previous
Next Post »