August 20, 2013

Use or not use blogging hacks?

by Indian Top Blogs

Before we come to the brasstacks...

This post applies to self-hosted blogs and free blogs on blogging platforms that allow html editing [e.g. Blogger] and not blogs on platforms that do not allow html editing [e.g.].

In an earlier post, we have discussed in detail the considerations for adding widgets on a blog. We won’t repeat them here. Since widgets also are pieces of code, some considerations would overlap and some of the discussion in the present post would apply to widgets too.

ITB will, now and then, bring some excellent and tested hacks to the notice of its visitors.

Hack… Did I hear it right?

Yes. We are talking here about the positive connotation of the term. A ‘hack’ refers to the modification made in the code of an original program with a view to enhance its functionality. In common parlance, unfortunately, the term is often used for changing of or intruding into a code with the intention of corrupting it or making it perform in a destructive way.

We, bloggers, often come across hacks or tweaking codes that help us add new features to our blogs, often free of cost.

A hack has to be applied by modifying or adding to the base code of the blog. When the code developer further converts it into a self-contained module that can be imported through non-technical operations, it becomes a widget.

Many functionalities that are available on Blogger platform now, such as ‘jump break, different types of archiving, favicon and stats, were available only as hacks, and adventurous bloggers made good use of these. 

What is the problem with applying useful hacks?

On the face of it, there is no problem. These small bits of codes are easy to implement and they give new functionality to the blog. However, they might pose some issues, and so you need to be forewarned.

Risk of malignant or shady code

We need to be sure that a script run by this code does not steal private information or introduce a harmful code into the user’s computer or blog. When Google discovers such a code on a Blogger blog, it stops the script and also informs the blogger.

Code conflicting with the base code of the blog

If the code in the hack is not properly composed or it tries to change some parameters that have been defined in the base code, the hack will not run. In extreme cases, it can produce very quirky effects on blog’s display, forms, etc.

Code not compatible with changes made later on in the base code

Suppose you tweaked the html of your Blogger blog or its individual pages / posts, and it worked fine. But Blogger later decided to update its base code. Chances are that the hack may not work or work differently.

Code not fully tested, so not functioning properly in some browsers or under some settings

This happens mostly with half-baked hacks.

Take precautions while applying a hack

Save the blog in full. In Blogger, the template editor allows you to save the blog as shown in the image here. Keep this back up till you are satisfied that the hack is working fine and you do not intend to go back to the earlier code. If the hack poses a problem, just select the entire code, delete it and copy-paste the saved code. It always helps if you also save a copy of changed code in a word-processing file [e.g. Word] and mention in it what was removed and added.


Use only trusted code. Don’t go by the hacker’s claim. Look at the comments the hacker’s website gets and search the web for more comments on the hack in forums and discussion boards. If you don’t get enough responses, ask about the hack in technology forums and hackers’ sites.

Check if the code is affecting the performance of the blog. The changed code has to run in addition to the base code and it might cause some delay especially if it runs a loop. A hack can also slow down your blog if connects to a third website to run a script.

Check if the code is affecting the design and looks of the blog. Check the impact by ‘previewing’ before saving the code. Even after saving, open the modified blog / page / post in different browsers and by resizing browser windows.

Take action later when the code’s functionality is available in the base code. After implementing a hack, if the same functionality is provided by the blogging platform, you may decide to remove the hack and go for the new in-built functionality.