Introduction to Bulletin Board Code (BBCode)


Bulletin Board Code (BBCode) is a light markup language preferably used in discussion forums and e-mails to beautify the way a message or post is presented .

The BBCodes can not be interpreted directly by a web browser, so the forum is responsible for translating BBCode markup into a language that web browsers can understand, either HTML or XHTML .

BBCode formally is not regulated, but due to their widespread use has become a de facto standard.


BBCode was created by PhpBB to their own forums and first introduced in 1998 with the forum software Ultimate Bulletin Board version 3. That is why it is sometimes also called UBBCode.

Thanks to its simplicity, power and functionality has been disseminated in the vast majority of web forums and even in emails.


BBCode was devised to provide a mechanism to allow users to improve the presentation of your message in a safer, easier and more limited way.

Previously many forums allow the use of HTML, with the side effect that if there was a misspelling, the entire HTML page layout is upset, or HTML could be used to include JavaScript which causes serious security issues to allow XSS attacks.

However, some implementations of BBCode have suffered problems with how they translate the BBCode to HTML, which might contradict the security that is trying to find BBCode. An alternative is a properly written HTML filter (many of which are freely available).

Although the basic BBCode tags are similar in most of the Internet forum software, as a result there are many variants which are often incompatible.

Some variants are case sensitive in the names of the labels, while others do not . Some variants have labels that highlight the HTML, ASP, PHP, SQL, and other markup languages and programming languages format, etc.

Structure and Syntax

BBCode is based on the HTML language, and is very similar to it in structure and syntax. BBCode has HTML elements and attributes, although being a simplified version of it is much easier to learn and use.

Elements are the basic structure of the language, each element has two essential properties: content and attributes.


Items in BBCode usually have a start tag and an end tag , the content is framed between the two tags. In BBCode tag name is enclosed in square brackets [ ] , unlike HTML, where the inequality symbols < > are used. Some labels contain a modifier , also known as attribute, whose value is assigned to the label itself with the symbol =.


Most of the attributes of an element in BBCode values are simply written in the start tag of an element and assigned to it by an equals sign = after the name of it.

The value may be enclosed in double quotes or not , most forum systems are tolerant to these modifications. However, leaving the values unquoted is considered an unsafe practice.

The general syntax is then:
[ tag_name = “attribute ” ] Content [/ tag_name ]

About these ads