Adding search to a public blog

Updated info after this post was created: CJ Eller's blog post explains how to custom style the search bar with javascript and CSS. He also provides further details on this in two posts on the community forum: post 1 and post2.

Searching a public or writefreely blog is easy to do, compared to searching private blogs or anonymous posts. It just takes adding an html iframe snippet to a blog page's source code, no javascript or CSS is needed. The blog must be public, if it's a private blog it won't work. For an example, take a look at this blog page: Then view the source code for that page (typically, right-click on the browser page and select View Source). You'll find the following snippet embedded in that code:

<iframe src=" The Plain Text Project" style="overflow:hidden;margin:0;padding:0;width:308px;height:40px;border-radius: 15px 50px 30px 5px;" frameborder="0"></iframe>

The DuckDuckGo search engine is used. Replace two parts of that code:

  1. Replace with either your personal domain name or your <blog> blog.

  2. Replace Search The Plain Text Project with your custom search message.

A couple points:

  1. You can search other public blogs or web sites if you want. It doesn't have to be your own blog.

  2. Since this snippet is html with no javascript or CSS, this will work in an anonymous post also. However, you would have to search a public blog or site. Anonymous posts and private blogs are not searchable with this technique (though see point #4 for a different way to search them).

  3. If your blog's url is in the form rather than, that might work as well. I quickly did a test and it appeared to work.

  4. If your blog is private or if you want to search your anonymous posts, you can still do it using, for example, a PHP program in combination with data downloaded from the API. This technique is outlined here. The technique described in that post requires that you have a web server with PHP support. If you don't have that, CJ Eller, community manager for, wrote a app that will do the search on your blog(s) and anonymous data downloaded via the and/or writefreely API.

  5. Of course, this html iframe snippet will also work on other web site pages besides just those created on or writefreely.

Thanks Plain Text Project for giving an example of how this can be done.