Title: wp-syntax-highlighter
Author: Darshan Sawardekar
Published: <strong>May 7, 2014</strong>
Last modified: August 7, 2014

---

Search plugins

This plugin **hasn’t been tested with the latest 3 major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://s.w.org/plugins/geopattern-icon/wp-syntax-highlighter.svg)

# wp-syntax-highlighter

 By [Darshan Sawardekar](https://profiles.wordpress.org/dsawardekar/)

[Download](https://downloads.wordpress.org/plugin/wp-syntax-highlighter.0.5.1.zip)

 * [Details](https://wordpress.org/plugins/wp-syntax-highlighter/#description)
 * [Reviews](https://wordpress.org/plugins/wp-syntax-highlighter/#reviews)
 *  [Installation](https://wordpress.org/plugins/wp-syntax-highlighter/#installation)
 * [Development](https://wordpress.org/plugins/wp-syntax-highlighter/#developers)

 [Support](https://wordpress.org/support/plugin/wp-syntax-highlighter/)

## Description

WP-Syntax-Highlighter is a WordPress plugin that brings the [Highlight.js](http://highlightjs.org)
based source code syntax
 highlighting to WordPress. This plugin is compatible with
any other syntax highlighter plugins that use [Syntax Highlighter](http://alexgorbatchev.com/SyntaxHighlighter/),
[GeSHi](http://qbnz.com/highlighter/) or [Prismjs](http://prismjs.com).

### Credits

 * Thanks to Ivan Sagalaev and the [highlight.js](http://highlightjs.org/) team 
   for this excellent library.

## Installation

 1. Click Plugins > Add New in the WordPress admin panel.
 2. Search for “wp-syntax-highlighter” and install.

### Customization

The plugin comes bundled with all the themes provided by Highlight.js.
 Use the 
Theme dropdown to change the selected theme.

Additionally the plugin checks for a `custom.css` in your current
 theme’s directory
at _{current\_theme}/wp-syntax-highlighter/custom.css_.

If this CSS file is present it will be added to the page automatically.
 You can
override any builtin theme’s styles in this manner.

To use a completely custom theme use the _Custom_ option in Theme
 dropdown. Now
only your current theme’s custom.css will be used to style the code blocks.

### Shortcodes

Each language gets it’s own shortcode. You can use this to add code
 blocks for 
that language into your posts.

For instance to add some PHP code into your post use,

    ```
            [php]
            foreach ($requirements as $requirement) {
              $result = array(
                'satisfied' => $requirement->check(),
                'requirement' => $requirement
              );

              array_push($results, $result);

              if (!$result['satisfied']) {
                $success = false;
              }
            }
            [/php]
    ```

### Supported Languages

The following languages are currently supported by highlight.js.

 1.  1c
 2.  Actionscript
 3.  Apache
 4.  Applescript
 5.  Asciidoc
 6.  Autohotkey
 7.  Avrasm
 8.  Axapta
 9.  Bash
 10. Brainfuck
 11. Clojure
 12. Cmake
 13. Coffeescript
 14. Cpp
 15. CS
 16. CSS
 17. D
 18. Delphi
 19. Diff
 20. Django
 21. Dos
 22. Erlang
 23. Erlang-repl
 24. Fix
 25. Fsharp
 26. Glsl
 27. Go
 28. Haml
 29. Handlebars
 30. Haskell
 31. Http
 32. Ini
 33. Java
 34. Javascript
 35. JSON
 36. Lasso
 37. Lisp
 38. Livecodeserver
 39. Lua
 40. Makefile
 41. Markdown
 42. Mathematica
 43. Matlab
 44. Mel
 45. Mizar
 46. Nginx
 47. ObjectiveC
 48. Ocaml
 49. Oxygene
 50. Parser3
 51. Perl
 52. Php
 53. Profile
 54. Python
 55. R
 56. Rib
 57. Rsl
 58. Ruby
 59. Ruleslanguage
 60. Rust
 61. Scala
 62. Scilab
 63. SCSS
 64. Smalltalk
 65. SQL
 66. Tex
 67. Vala
 68. Vbnet
 69. Vbscript
 70. Vhdl
 71. XML

Note: Since WordPress shortcodes must be at least 2 characters long, for
 language
names shorter than 2 characters use the `lang` suffix.

Eg:- [dlang][/dlang]

### Compatibility with other Syntax Highlighters

The plugin is completely compatible with other syntax highlighters.
 It does not
change the content of your existing posts. You can safely go back to use your previous
syntax highlighter after trying out wp-syntax-highlighter.

Both [Syntax Highlighter](http://alexgorbatchev.com/SyntaxHighlighter/) and [GeSHi](http://qbnz.com/highlighter/)

and supported by default. [Prism](http://prismjs.com/) based syntax highlighters
will also work out of the box as they utilize the same markup as Highlight.js.

## FAQ

 * Can I go back to my previous syntax highlighter plugin after using
    this?

Yes. The code block scanning is done clientside by highlight.js. The
 contents of
your posts are only scanned to pick any embedded languages.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“wp-syntax-highlighter” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ Darshan Sawardekar ](https://profiles.wordpress.org/dsawardekar/)

[Translate “wp-syntax-highlighter” into your language.](https://translate.wordpress.org/projects/wp-plugins/wp-syntax-highlighter)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/wp-syntax-highlighter/),
check out the [SVN repository](https://plugins.svn.wordpress.org/wp-syntax-highlighter/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/wp-syntax-highlighter/)
by [RSS](https://plugins.trac.wordpress.org/log/wp-syntax-highlighter/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 0.5.1

 * Upgrades to Arrow 1.8.0.

#### 0.5.0

 * Upgrades to Arrow 1.6.0.
 * Updates Highlight.js to 8.1.
 * Refreshes themes from Highlight.js repository.
 * Cleaner build without development assets.

#### 0.4.0

 * Upgrades to Arrow 0.7.0

#### 0.3.0

 * Upgrades to Arrow 0.3.0.

#### 0.2.2

 * Fixes typos.

#### 0.2.1

 * Upgrades Arrow to 0.4.1.

#### 0.2.0

 * Switches to Arrow 0.4.0.

#### 0.1.2

 * First release on wordpress.org

#### 0.1.0

 * Initial Release

## Meta

 *  Version **0.5.1**
 *  Last updated **12 years ago**
 *  Active installations **10+**
 *  WordPress version ** 3.5.0 or higher **
 *  Tested up to **3.9.40**
 * Tags
 * [code highlighter](https://wordpress.org/plugins/tags/code-highlighter/)[syntax highlighter](https://wordpress.org/plugins/tags/syntax-highlighter/)
 *  [Advanced View](https://wordpress.org/plugins/wp-syntax-highlighter/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/wp-syntax-highlighter/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/wp-syntax-highlighter/reviews/)

## Contributors

 *   [ Darshan Sawardekar ](https://profiles.wordpress.org/dsawardekar/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/wp-syntax-highlighter/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](http://pressing-matters.io/)