Search page in blog


First of all, as usual, my apologies if this has been covered before.
I did find some posts in here on search boxes, but nothing I could really use with my basic skills.

Is there a guide on how to implement a search feature in blogs in, that does not use google services?
Something like this:

Or, if no notes exist, is there a good, patient soul willing to help me implement this?


Hi @Melyanna!

I was able to remix the search app I use for my blog into something like this that uses your theme and searches your blog. What do you think? All you would need to do is pin a placeholder post (like for example) and add the following JavaScript to the Custom JavaScript on your Customize page:

const search = document.querySelector('a[href*=""]');
pinned.href = '';

Hope that helps! Would be glad to help further.


EDIT: well, actually, while it does look amazing, I gave this a try on my blog and I don’t see a search box in the search page.

What I did:

  1. copy-paste your code and put it in the custom js box of my blog.
  2. added a “Search” page and pinned it.
  3. hit save.

All I could see was the bunch of text I had in the search page (“you can search this blog for specific words”) and nothing else.

I don’t think I can make an empty page with just a title (in case the text in the body of the page is the issue).

It was nothing on your end @Melyanna. I goofed up with the JavaScript! Here is the edited code:

const search = document.querySelector('a[href*=""]');
search.href = '';

I forgot to make it search.href and instead had it as pinned.href. So since no variable is declared in the JS as “pinned”, nothing happens.

Let me know if that works for you!


Thank you so much!
It works perfectly now. :slight_smile:

1 Like

No problem! I am glad it’s finally working for you. Let me know if you need any edits to it and I can gladly do so.

1 Like