Tuesday, July 22, 2008

Help Your Readers Search Your Blog

When your blog gets larger, you'll want your readers to be able to find the content easier - sometimes using more detail than can be found in the Archives index.

You can generally use Labels for a more comprehensive index of the blog contents - but both labels, and titles, index the posts based on your vision of the blog. What if you want your readers to view your blog, on their terms?

This is where the Navbar, with its search box, becomes useful.

The Navbar based search is a good choice - assuming that you don't block the Navbar, and assuming that your readers like using the Navbar.

But you're not confined to using the Search box on the Navbar - you can make your own search box, and position it where you like.

Setup a new HTML / JavaScript gadget, to get a very simple search box for your blog.




Just copy the code - a simple 4 lines - to the new gadget.

<form action="/search" method="get">
<input name="q" type="text"/>
<input value="Search This Blog" type="submit"/>
</form>

Having setup your new gadget, you can position it anywhere on the page. Or, you can have a search box inside a post, as I show above. See "Search This Blog", above - and "Search The Real Blogger Status", at the top of the sidebar?

You can get way more fancy, for instance search multiple blogs at once, using a Google Custom Search box, but for a 5 minute blog upgrade, this is all that you need.
  • Search only your blog.
  • Search your blog directly, not from search engine cache. No waiting for search engine updates.
  • Search private blogs, with some chance for success.
  • Display search results as part of the blog display, with all blog accessories and decorations visible.
This is very user friendly - your readers will appreciate it.

>> Top

19 comments:

Arizona Steve said...

Hey, do you know of any way for ftp published blogs to add a search box like this? We don't get access to all the nifty Blogger elements. :(

Chuck said...

Steve,

This feature is plain old JavaScript, which will work fine in a Classic template. You will have to edit the template HTML, but beyond that issue, it's perfectly doable.

Peg in South Carolina said...

Thank you! I did it and it's neat.

Elaine Garrett said...

I just discovered your series of posts on adding this search to my blogspot blog. Understand that I'm not tech savvy. I went into "Add a Gadget" but could not locate "Find and select "HTML/JavaScript".

I've copied and saved the code. Hope you can direct me to where it goes.

Chuck said...

Elaine,

I don't enjoy the disarray of the list in "Add a Gadget", but "HTML/JavaScript" is in the "Basics" list, a bit more than half way down (right now). You'll have to look very carefully.

Jim Davis said...

I'm trying to set up a search box for an ftp published blog but I can't get it to work. I tried replacing "/search" with my URL/search and got nowhere. I set up a directory named "search" but got nowhere again. Obviously I need to learn a lot more. I'll appreciate any help.

Thanks,

Jim

Chuck said...

Jim,

With BlogSpot / Google published blogs, there's a standard folder URL structure. This pos, for instance, is "blogging.nitecruzr.net/2008/07/help-your-readers-search-your-blog.html", and it's in folder "/2008/07". The search term "/" directs the search to start at the root, ie at the level above "2008".

If you publish your main page to the root of your blog, with the archives under it ("2009", "2008", etc), I would think that a search of "/" should work. Unless the search only works for dynamically published blogs (BlogSpot / custom domain).

Ames Swartsfager said...

I have completed setting up my blog, but it does not come up when I search for it on the net. It is written(published/) for BlogSpot.com, Google. What do I need to do to launch on the net??
Ames in CT.

Chuck said...

Ames,

You launch your blog on the net with lots of hard work.

Cheryl said...

Wow, I just keep clicking on things on this blog and learning and learning. I will be spending lots of time here, thanks.

RADIO BAJAO said...

it is simple and really great.

kavitaskitchen said...

Thanks for all the information. I was a little disappointed with no activity on my blog(it is barely a week old) but it would also not show up in the google search engine,I have a lot of answers now and it is some solace. I have also gone through lot of hard work and I am implementing most.Thanks I will keep trying and will continue to read the information here:)

Outlier Babe said...

Thanks. Just thanks.

Noisy Quiet said...

Hi there. I'm having an annoying problem with my navbar searches on one of my blogs. A basic search widget like yours (not the google one) yields the same problematic results as the navbar search. It seems I'm not the only one on blogger with this issue (complaints go back to 2009) but I was wondering if you'd ever read of a workaround or fix.

From troubleshooting today I've found that:

1) Only posts past a certain date appear in the search (even if you click "show older posts.")

2) It may be related to posts that are back dated to before the blog was created, but I can't find a uniform number of days for that. Though with two test blogs I created today, the magic number seemed to be "7." Posts dated 7 or more days before today don't show up in search results. (- My existing blog with this issue doesn't fit the 7 day pattern.)

3) The above holds true for posts created today, saved, and then back dated to 7 days or more ago, as well as imported posts.

4) If the blog is made private, the search works perfectly. - But the problem returns as soon as it's made public again.

5) On the Edit Posts page, the search box there has the exact same issues if you search with "Published" posts selected, but works perfectly with "All" posts selected. (and if the blog is set to "Private" it works correctly with "Published" too.)

That's all I remember off the top of my head.

Thoughts? It's so darned frustrating :P

Dawn Paoletta said...

Thanks! Happy New Year!

DetroitVideoDaily said...

Thanks for supplying the html for the search box! I discovered that my blog's gadget was no longer working. Now that I used your code, all is good. Much appreciated.

My anxious life said...

Thank you!!!

The Singapore Writing Homemaker said...

Thank you Chuck for showing this search box! It is been very helpful!

Mike said...

Thank you - that's really helpful. Now that I have a seach box I can disable the Navbar.