Simple HTML for Formatting Blogger Comments

Wed 30 Aug 2006

Sherdie, fellow Brisvegas blogger, has asked for some tips on adding styles to Blogger comments. Many bloggers have tools for adding formatting to their posts, but not their comments.  I thought I’d post my answer here so that other bloggers can benefit as well.

We’ll cover just simple stuff, bold, italics and hyperlinks.

[Note to advanced web developers and XHTML coders: Nothing to see here folks. Move along.  Corners (and some W3C XHTML validation rules) will be cut.]

When can we use formatting?

Good news: Usually  Bad news: Not always.

Blogger Comment FormSome blogging software and some blog owners can turn off HTML formatting. Sometimes you just won’t know until you try it. A good indication that you can use HTML formatting is if the comment form says something like…

You can use some HTML tags, such as <b>, <i>, <a>

What is a Tag?

Very simply, a tag is something enclosed in angle brackets <>.  For example, <b> is the tag for “Turn Bold On”.

When your readers’ browsers (Internet Explorer, Firefox, whatever) encounter tags that they recognize, they will replace these tags with formatting.

Don’t forget the End Tag.

Note that each of the tags we are using here, work in pairs. That is, there is a Begin Tag and a corresponding End Tag which starts with a slash /. For every <b> (bold on), there must be a corresponding </b> (bold off).  This is important.

Bold

Surround the text you want to appear in bold with <b> and </b> tags.  Example, type this into the comment box:
  Sometimes I just want to <b>shout</b>!

Readers will see this:
  Sometimes I just want to shout!

Italics

Enclose the text you want to appear in italics with <i> and </i> tags.  Example, type this into the comment box:
  I thought, <i>Hang on a minute, Defrag!</i>

Readers will see this:
  I thought, Hang on a minute, Defrag!

Hyperlinks

Including a Hyperlink in a comment is very similar to Bold and Italic. Hyperlinks use the <a> (for “Active”) tag.

Step one is to enclose the text you want to appear as a hyperlink with <a> and </a> tags.  Example, type this into the comment box:
  You should read <a>MikeFitz's post</a>

If you leave it at that, readers will see this. Note that the hyperlink doesn’t work yet:
  You should read MikeFitz’s post

Step two is to include the address that you want to link to in the opening <a> tag.  This is done by including href="" in the tag. Then place the address between the two "" characters.  (The address is the thing that starts with http://. You probably already know that you can copy the address from the address bar at the top of your browser.)

For example, here we have added the href="":
  You should read <a href="">MikeFitz's post</a>

Finally, here it is with the address placed between the two "" characters:

  You should read <a href="http://mike.brisgeek.com/2006/08/30/simple-html-for-formatting-blogger-comments/">MikeFitz's post</a>

And here’s what readers will see:
  You should read MikeFitz’s post

Bold and Italics (Walking and Chewing Gum)

Bold and Italics can be combined provided they are nested correctly.  Example:
  I shouted: <b><i>Look Out!</i></b>

Readers will see:
  I shouted: Look Out!

This is an example of incorrect nesting.  The </i> should come before the </b>  Don’t do this:
  I shouted: <b><i>Look Out!</b></i>

Bold, Italics and Hyperlinks (Walking, Chewing Gum and Talking to your Mother on your Mobile)

Here’s a more complex example where correct nesting is important:

  One of my favourite books is
<a href="http://www.awprofessional.com/bookstore/product.asp?isbn=0201633612&rl=1"
title="Addison-Wesley website">
<i><b>Design Patterns</b>
: Elements of Reusable Object-Oriented Software</i>
 by Gamma, Helm, Johnson and Vlissides</a>.

Readers will see:
  One of my favourite books is Design Patterns: Elements of Reusable Object-Oriented Software by Gamma, Helm, Johnson and Vlissides.

and Finally

Hopefully my fellow bloggers will find this information useful when commenting.

If you found it useful, please let me know or leave a comment. If you find an error, let me know about that too.

Happy Blog Commenting — Mike

52 Responses to “Simple HTML for Formatting Blogger Comments”

  1. sherdie Says:

    Well, MikeFitz, I feel more learned now. In fact, I applaud you.

    *hopes she didn’t bugger it up*

  2. MikeFitz Says:

    Well done, Sherdie.

    Are you sure you haven’t played this game before?

  3. sherdie Says:

    You should have seen how long it took me to do that. I’ve always been of the trial-and-error school of html (aka the google and wikipedia school) so it’s nice to have it all set out. Also, didn’t know that nesting was important. So all silliness aside, thank you!

  4. Dion Says:

    Excellent overview, Mike, without getting bogged-down in unnecessary detail.

  5. Miff Says:

    Oooh, this will make me feel so much more celverererer when I make comments now! I won’t show off like Sherdie (although if she hadn’t done it I would have). Thanks for the tips!

  6. MikeFitz Says:

    Dion: Thanks, hopefully I found the sweet spot between too much and not enough.

    Miff: Happy to help!

  7. John Lynch Says:

    Thanks a lot for posting this- found it through Google. Very helpful.

  8. MikeFitz Says:

    Thanks, John. You’re welcome.

  9. Belongum Says:

    Ah - thanks to Google eh…

    Just what I needed to know thanks Mike… Cheers ;-)
    Belongum

  10. MikeFitz Says:

    You’re welcome, Belongum. Thanks for dropping by and commenting. This post seems to get quite a few visitors via Google.

  11. Kimsta Says:

    Hello,
    I have a question: do you have the code/instruction for adding this “leave a reply” section for each post in Blogger?

  12. MikeFitz Says:

    G’day Kimsta. This is a self-hosted WordPress blog backed by a mySQL database. I’m pretty sure the code you are after is part of the WordPress software which is available free.

    However, I don’t think out-of-the-box Blogger allows you to enter comments on the same page as the post. Instead it takes readers off to a separate https:// page.

    Even if we could modify a Blogger template to include this “Leave a Reply” form, I doubt Blogger would give our code permission to write to the database where comments are stored. Interesting idea though.

    Cheers — Mike

  13. Kimsta Says:

    Thanks for the reply, Mike. How is Beautiful Queensland today? I’m from Melbourne :-)

  14. MikeFitz Says:

    28°C, gentle breeze, dappled sky, you wouldn’t like it. Victorians should stay where they are and be happy with their lot. :P

  15. Susan Abbott Says:

    Thanks for the tips. I was trying to edit some comments in my own blog, and then realized I had turned off all the formatting. Now happy again, thanks for the tips.

  16. Chris Rolitsky Says:

    Just testing the italics command. Thanks.

  17. MikeFitz Says:

    You’re welcome, Susan.

    Chris, congratulations! You italics skills are now second to none!

  18. Cecelia Says:

    I did it! Maybe now my blog will get noticed a bit more. Thank you.

  19. Timmy Says:

    test
    google
    test
    google

  20. Susie Says:

    Absolutely great - thank you! Easier than I ever would have thought. Mind if I practice?

  21. Jonathan Says:

    Thank you. Good stuff and helpful for a rookie like myself.

  22. Aleathea Says:

    Great information - just what I was looking for! Thank you!!

  23. Mrs. Who Says:

    I have been trying to figure out how to put links to blog posts I wanted to reference in comments for AGES. This is a life saver. Thanks!!

  24. Unfrench Says:

    I am looking for a way to add such tags as a in comments. Any idea how I can do it?

  25. Mark Says:

    “You can use some HTML tags, such as <b>, <i>, <a>”

    The words, “such as” lead me to believe other tags I can use i the when commenting back. Are there other tabgs I can use? What are they?

    Thanks.

  26. veso Says:

    i want to try this because I couldn`t make it work!

  27. Mp3 Affirmations Says:

    Mike

    Thank you for your very usable information!

    I’ve always wondered how the tech experts were doing that!

    I will use it for my Positive Affirmations based website! (Hope that works!?)

    Thank you again,

    Johnny London

  28. MikeFitz Says:

    Hi Johnny,

    I see you also added the rel=”nofollow”. Are sure you are a newbie at this?

  29. aldiO Says:

    Thank you. Good work!

  30. Eldon Mast Says:

    This is good news!

    Thanks,

    Good News Economist

  31. lori Says:

    Thanks a bunch for posting this information. Exactly what i was looking for.

  32. Dani Says:

    Thanks…I was able to hyperlink in my comment!

  33. Christopher Radko Says:

    Thanks, for this article I can now link in Blogs…Finally :)

    Thanks,
    Radko Christmas Ornaments

  34. andy sewina. Says:

    Thanks Mike, you explain this so well, I often get asked how to hyperlink comments, and it’s difficult to explain. I’ll be sending them to you in future.

  35. Janet Says:

    Thank you. Now I can look as cool as the next sweet talking guy.

    Here is my first attempt…

    Andy Sewina passed this on to me.

  36. reneamac Says:

    I’ve been wanting to insert hyperlinks into blog comments for a long time. Wish I had found you sooner! Thanks.

  37. greekbox Says:

    Nice article.

    May I ask, is there any way to change allowed tags in comments box?
    (In wordpress I know there is, so I ask for blogger).
    Some wordpress blogs allow: object, embed, and img tags in comment box so yoy can embed a youtube video as a comment!
    What about blogger?
    Thanks.

  38. David Says:

    ok what the heck,

    Im folloing exactly what you say but my super awesome comment isent leading to superawesomedating.com when i use it on other sites.

    Either the link is just highlighted but is not clickable OR it creates a hyperlink to (for example) www.domain.com/post-title/comments-page-2/superawesomedating.com which ends up as a page not found error.

    Please help! Feel free to email me.

  39. MikeFitz Says:

    Hi David,

    Your link is missing the “http://”

    Do this: <a href=”http://www.domain.com”>super awesome</a>

    NOT this: <a href=”www.domain.com”>super awesome</a>

    Without the “http://”, your link is interpreted as a page on the current site.

    Cheers — Mike

  40. Retka Zverka Says:

    Hi Mike,

    Thank you for such a great explanation! Your article helped me to place a Hyperlink in the Blogger comment form. :-)

    Cheers buddy!

  41. mitch Says:

    Thanks - I was looking for that.

    And a test to see if I got it right!!

    If you use xTuple and want your database in the cloud - then we have a hosted solution

  42. MikeFitz Says:

    Hi Mitch,

    Unfortunately your hyperlink contained too many double-quotes around the hyperlink address.

    You said:
    we have a <a href=””http://www.opensurgegroup.com/host/host.html”” rel=”nofollow”>hosted solution</a>

    Try this instead:
    we have a <a href=”http://www.opensurgegroup.com/host/host.html” rel=”nofollow”>hosted solution</a>

  43. Rob Says:

    Thanks for the info. Its good to know. I’ll have to share a link on my blog: www.ninehats.com

  44. boardtc Says:

    I wish it would allow the <ul> tag so one could show lists in comments.

  45. triton Says:

    can i insert a picture in the comment?

  46. freann Says:

    hello sir.

    can you tell me how to post an HTML comment (for example, image from photobucket.com) then below the image, you will write your message without being hyperlinked..

    that’s really my problem now.. :(
    can you tell me what to enclose my text ?

    thank you very much.
    God bless.

  47. MikeFitz Says:

    Hi Freann, Something like this?


    A picture with a caption.

    Note that not all blogs will allow images, but if they do, here’s what you need for the image…

    <img src=”http://url_of_your_photobucket_image” />

    Your caption is then just plain text on the next line.

    Cheers — Mike

  48. christian m Says:

    Thank you So Much. I have been Searching for this.
    I used it on my website’s comment Casino Galore

  49. ANDAMAN & NICOBAR THE HISTORIC INDIAN CORAL ISLANDS Says:

    Hi, Thanks a lot, dear Mike, for the wonderful tutorial on HTML for formatting Blogger Comments. I’ve just tried in in my blog and it seem to work fine.

    I’m just trying it out, here, too, just in order to check up. Hope, you don’t mind.

    NETAJI GAVE FIRST FREEDOM TO INDIA IN ANDAMAN

  50. ANDAMAN & NICOBAR THE HISTORIC INDIAN CORAL ISLANDS Says:

    Woooooooow… Look at that…!
    It does work, Mike! Thanks a ton, again, for the excellant tutorial! Wish you and your family a mighty Happy, Peaceful and Prosperous New Year 2010…! Cheers!!! :))

    Shrinath Vashishtha
    Port Blair
    Andaman & Nicobar Islands (India).

  51. Charissa - The Gifted Blog Says:

    Thank you! Your post is the first that popped up when I searched “hyperlink in blogger comment”, and I have referenced your instructions multiple times already. Finally, I know how to put my website address in as a link (www.thegiftedblog.com) and not plain text!

    Really appreciate it.

  52. Rich Says:

    Woooooooow… Look at that…!

    I’m testing this out….this was helpful!

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Comment moderation is in use. Please do not submit your comment twice -- it will appear shortly.