---
title: New Plugin: Code Prettify (Syntax Highlighter)
date: 2013-05-23T11:30:08+00:00
modified: 2013-05-26T20:01:13+00:00
image:: https://kaspars.net/wp-content/uploads/2013/05/screenshot-1.png
permalink: https://kaspars.net/blog/plugin-code-prettify-syntax-highlighting
post_type: post
author:
  name: Kaspars
  avatar: https://reverse.kaspars.net/gravatar/avatar/92bfcd3a8c3a21a033a6484d32c25a40b113ec6891f674336081513d5c98ef76?s=96&d=mm&r=g
post_tag:
  - Plugin
  - Tool
category:
  - WordPress
---

# New Plugin: Code Prettify (Syntax Highlighter)

Most syntax highlighters use either shortcodes or make you add some obscure CSS classes to all `<pre>` tags that you want to highlight. Even WordPress.com does that.

### Introducing Code Prettify Syntax Highlighting Plugin

[**Code Prettify for WordPress**](https://github.com/kasparsd/code-prettify) is a new plugin with just 31 line of code that enqueues the [Google Code Prettify](https://code.google.com/p/google-code-prettify/) library (one minified javascript file) which then parses all `<pre>` tags on the page, detects the correct language and lazy-loads the necessary syntax module, and applies the highlighting.

[![Code Prettify (Syntax Highlighter) WordPress Plugin](https://kaspars.net/wp-content/uploads/2013/05/screenshot-1.png?strip=all&quality=90&resize=500,529 "Code Prettify (Syntax Highlighter) WordPress Plugin")](https://github.com/kasparsd/code-prettify)

No shortcodes, no custom CSS classes — just magic.