Plugin info

Total downloads: 37,852
Active installs: 1,000
Total reviews: 26
Average rating: 5
Support threads opened: 0
Support threads resolved: 0 (0%)
Available in: 11 language(s)
Contributors: 4
Last updated: 11/30/2025 (31 days ago)
Added to WordPress: 7/30/2019 (6 years old)
Minimum WordPress version: 6.6
Tested up to WordPress version: 6.9
Minimum PHP version: 7.4

Maintenance & Compatibility

Maintenance score

Actively maintained • Last updated 31 days ago • 26 reviews

65/100

Is Syntax-highlighting Code Block (with Server-side Rendering) abandoned?

Likely maintained (last update 31 days ago).

Compatibility

Requires WordPress: 6.6
Tested up to: 6.9
Requires PHP: 7.4

Similar & Alternatives

Explore plugins with similar tags, and compare key metrics like downloads, ratings, updates, support, and WP/PHP compatibility.

Code Syntax Block
Rating 4.9/5 (48 reviews)Active installs 8,000
Code Snippets in Comments
Rating 0.0/5 (0 reviews)Active installs 0
io Code Highlight
Rating 0.0/5 (0 reviews)Active installs 100

Description

This plugin extends the Code block in WordPress core to add syntax highlighting which is rendered on the server. Pre-existing Code blocks on a site are automatically extended to include syntax highlighting. Doing server-side syntax highlighting eliminates the need to enqueue any JavaScript on the frontend (e.g. Highlight.js or Prism.js) and this ensures there is no flash of unhighlighted code (FOUC?). Reducing script on the frontend improves frontend performance, and it also allows for the syntax highlighted code to appear properly in AMP pages as rendered by the official AMP plugin (see also ampproject/amp-wp#972) or when JavaScript is turned off in the browser.

This extended Code block uses language auto-detection to add syntax highlighting, but you can override the language in the block’s settings sidebar. (There is currently no syntax highlighting of the Code block in the editor, but see #8.) The plugin supports all programming languages that highlight.php supports (being a port of highlight.js). The Code block also is extended to support specifying lines to highlight which get marked up with mark elements (including in RSS feeds). There is also a checkbox for whether to show line numbers on the frontend (with the numbers being non-selectable). Lastly, given inconsistencies across themes regarding whether lines in a Code block should be wrapped, this plugin adds styling to force them to no-wrap by default, with a checkbox to opt in to wrapping when desired.

For advanced usage, please see the plugin wiki.

This plugin is developed on GitHub. See list of current issues with the plugin. Please feel free to file any additional issues or requests that you may come across. Pull requests are welcome. See contributing information.

Credits

This is a fork of Code Syntax Block by Marcus Kazmierczak (mkaz), which is also available on WordPress.org. Copyright (c) 2018 Marcus Kazmierczak. Licensed under GPL 2.0 or later.

highlight.php is released under the BSD 3-Clause License. Copyright © 2006-2013, Ivan Sagalaev ([email protected]), highlight.js (original author). Copyright © 2013, Geert Bergman ([email protected]), highlight.php

Installation

No installation instructions available

Frequently Asked Questions

No FAQ available

Review feed

Ronald Huereca
10/24/2020

This Plugin is Amazing

I love that this is baked into the core code block without having to resort to a third-party integration that may or may not work. Well done on this one. Just a heads up though, which may require more testing. The latest Gutenberg release and this plugin do not appear to play well together. I had to disable the Gutenberg plugin, which invalidated the code blocks, and I had to recover each one. One feature request: Please add a rel attribute so I can display the language. Thanks again, Ronald Huereca
Nick Diego
1/2/2021

Awesome plugin

This plugin is the best syntax highlighting plugin that I have used, thanks for all the hard work in developing it. One recommendation though... I just stumbled upon the ability to change the color scheme in the Customizer. This is an awesome feature, but not one that is highlighted in the description of the plugin or in the screenshots. Of course it is mentioned in the Advanced Usage wiki, but I have been using the plugin for months and definitely overlooked that 😉. A brief mention in the main description and a screenshot of the different theme options would definitely help unobservant users like myself. Thanks again!
Nivardo Ch
9/5/2021

Excelente plugin

Excelente plugin
bradvin
1/21/2022

Great plugin with no setup needed

Just found this gem of a plugin when looking for code syntax highlighting plugins. No hassle at all to get working, just install and activate and it formats and styles existing code blocks in posts. Could not be happier with this plugin. Wlldone!
Gwyneth Llewelyn
7/13/2022

It's time to switch to get more performance!

I confess, I've been a happy user of Code Syntax Block for quite a while — a plugin which the author, Weston Router, clearly states that Syntax Highlighting (Code Block) is based upon. Alas, however, all the pages I had with the older plugin would suffer from an inevitable rendering slowdown — there is so much Javascript on web pages these days that such a slowdown is inevitable, and this is especially true to those scripts that attempt to recognise the language automatically — something that will consume plenty of CPU cycles on the browser. Parsing the language is also no mean feature by itself (I know, I've been doing some experiments for some code editors, and, believe me, it's tough!). So why force the end-user to bear the burden of all that work? It makes much more sense to pre-render everything on the server, and then let the web server send the already-parsed HTML from its cache. That way, the end-user will already have everything on their browser, no need to wait for parsing! Also, if you 'forget' to set the language that your code is in (it happens...), the auto-detecting feature will only run on the server, and just once, when you save the post you're writing. Even if it takes a fraction of a second more to save, think of how much time all those users will save when they get the already-rendered page! So, this plugin is definitely recommended. As a bonus: if you are already using some sort of code block on your WP setup, once you turn off whatever plugin you were using, Syntax Highlighting (Code Block) will immediately pick it up and start its magic (you might need to open and save all the pages you've got code on, though — I'm not quite sure if that's really the case). That means zero effort (beyond saving) — what you already had will continue to work. And, naturally enough, when you disable this plugin, your code block will just revert to the internal WP code block instead — nothing will be 'lost' that way! If you're still hesitant and reading this to the end... while you wasted your time here, think of how many of your users would have saved their time if you already had this plugin installed :)

Screenshots

  1. Code blocks can be added as normal, optionally overriding the auto-detected language. Also specify any lines to be highlighted, whether to show line numbers, and if the lines should wrap.

    Code blocks can be added as normal, optionally overriding the auto-detected language. Also specify any lines to be highlighted, whether to show line numbers, and if the lines should wrap.

  2. The Code block renders with syntax highlighting on the frontend without any JavaScript enqueued. Stylesheets are added only when block is on the page.

    The Code block renders with syntax highlighting on the frontend without any JavaScript enqueued. Stylesheets are added only when block is on the page.

Changelog

For the plugin’s changelog, please see the Releases page on GitHub.