How To Colorize Source Code Snippet In WordPress Post

There are lots of WordPress plugins for colorizing source code syntax, and many of them are pretty good.

Two most impressive I found are Crayon Syntax Highlighter and SyntaxHighlighter.

Both are great, and it’s hard to decide which is better. Both probably have more options than common user needs. Finally, I decided to use Crayon because it has slightly better ranking in WordPress plugins directory. Here is one small sample:

// Hello World in JavaScript
alert('Hello World!');

Websites hosted on have pre-installed syntax plugin. To place source code in article on blog hosted on, just use [sourcecode] or just [code] tag in text view. For previous code example if your blog is on you, should write something like this:

[code language=”javascript”]
// Hello World in JavaScript
alert(‘Hello World!’);

More info about this feature you can find on