PrettyCode • Code syntax highlighting with CodeMirror


The prettiest syntax highlighting block for the WordPress editor.
Live edit your code snippets in the admin with bracket matching, customize colors with more thant 50 themes (Base16, Monokai, Material, Zenburn, Hopscotch…).
Compatible with major languages: HTML, CSS, JS, JSX, Stylus, Sass, PHP, Python, C, C++, C#, Java, XML, Shell, JSON, Go, Swift…

This block uses CodeMirror. You may have seen this block before on the Advanced Gutenberg Blocks plugins few years ago. It’s now an updated and standalone block.

Third Party

This plugins uses some third party libraries:

  • WordPress create-block by gziolo –
  • CodeMirror –
  • react-codemirror2 by scniro –

A big thanks to their respective creators and maintainers!



This plugin provides 1 block.

  • PrettyCode A code syntax highlighting block for your snippets of all major languages.


  1. Upload the plugin files to the /wp-content/plugins/prettycode directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the ‘Plugins’ screen in WordPress
  3. Go to a post and click on ‘Add block’
  4. Search for ‘PrettyCode’


Which languages are available?

All major language are available: HTML, CSS, JS, JSX, Stylus, Sass, PHP, Python, C, C++, C#, Java, XML, Shell, JSON, Go, Swift…

Can I add more languages ?

Yes, by using the filter prettycode_languages_list.

Can I customize the appearance?

Sure! You have access to 50+ dark and light themes like Base16, Monokai, Material, Zenburn, Hopscotch…

Can I contribute?

Yep! The public repository is right here:


March 8, 2022
Merci d'avoir transposé le bloc en standalone, il était vraiment cool dans AGB.
Read all 2 reviews

Contributors & Developers

“PrettyCode • Code syntax highlighting with CodeMirror” is open source software. The following people have contributed to this plugin.


“PrettyCode • Code syntax highlighting with CodeMirror” has been translated into 1 locale. Thank you to the translators for their contributions.

Translate “PrettyCode • Code syntax highlighting with CodeMirror” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.



  • Fixed code editor line height


  • Added translation for JS files
  • Fixed a bug with PHP block


  • Initial release