Wordpress Code Highlighting

With as many people blogging on Wordpress that wish to show code snippets I would have thought some better solutions for syntax highlighting would have been available by now. Unfortunately support is limited to only a handful of 3rd party modules each of which having their own limitations or issues that must be overcome.

Here are the various solutions I tried along with my comments:

WP-Syntax (http://wordpress.org/extend/plugins/wp-syntax/)



  • Simple to use with <pre> tags
  • Uses GeSHi for highlighting resulting in a wide variety of supported languages
  • Easy to copy code from the page without getting the formatting / line numbers with it


  • Requires some minor tweaks to the CSS to get it to work (perhaps this is just my theme)

SyntaxHighlighter (http://wordpress.org/extend/plugins/syntaxhighlighter/)



  • The best layout of any of the plugins I tried
  • Plain and Print views for viewing the source


  • A much more limited set of languages supported
  • Copying code from the plugin requires a special mode.


After playing with both of these libraries and feeding them a variety of code snippets, I settled upon wp-syntax. While it did require a few modifications to the CSS to get the line numbers to match with the code, the wider variety of supported languages was the key feature for me. I also modified the CSS to match my theme for both the plugins, so out of the box they dont look quite like my pictures shown.


Leave a Reply