WPThumbs
Themes Plugins By purpose By industry Best-of lists Fix it guides
Free Plugin by Weston Ruter v1.5.2

Syntax-highlighting Code Block

Extending the Code block with syntax highlighting rendered on the server, thus being AMP-compatible and having faster frontend performance.

Syntax-highlighting Code Block

The facts

Rating
5★ from 26
Active installs
1k+
Price
Free
Last updated
19 May 2026
Added
Jul 2019
Requires WP
6.6
Tested up to
WP 7.0.4
Requires PHP
7.4
Downloads
44,640

Our analysis

AI-assisted

The Syntax-highlighting Code Block plugin enhances the standard Code block in WordPress by adding server-side syntax highlighting. This feature eliminates the need for frontend JavaScript, improving performance and ensuring proper rendering in AMP pages or when JavaScript is disabled in the browser.

It automatically extends existing Code blocks to include syntax highlighting and supports all programming languages compatible with highlight.php. Users can override language detection, specify lines to highlight, and choose whether to display line numbers.

Best for: This plugin is suitable for developers and content creators who need to display code snippets with syntax highlighting on their WordPress sites.

What it does well

  • Adds server-side syntax highlighting to Code blocks
  • Improves frontend performance by reducing JavaScript usage
  • Supports all programming languages that highlight.php supports
  • Allows specifying lines to highlight and showing line numbers
  • Automatically extends pre-existing Code blocks

Where it falls short

  • No syntax highlighting in the editor
  • Limited information on advanced usage

Verdict

The plugin effectively enhances the Code block functionality, making it a practical choice for those looking to improve code presentation without compromising site performance.

From the developer

Weston Ruter's own description of Syntax-highlighting Code Block, lightly tidied.

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 (maniac@softwaremaniacs.org), highlight.js (original author). Copyright © 2013, Geert Bergman (geert@scrivo.nl), highlight.php

Read the full description on the official page →

Tagged as

Alternatives

Other plugins for aggregating content.

WP RSS Aggregator

The #1 WordPress RSS aggregator to quickly import RSS feeds, build a news aggregator, and for easy autobloggin...

Free 40k+ installs 4.5★ (562)
RSS Aggregator by Feedzy

The most powerful WordPress RSS aggregator, helping you curate content, autoblog, import RSS & display unl...

Free 40k+ installs 4.6★ (361)
Ditty

Ditty

86

Ditty offers a range of content display options, including its signature news ticker and customizable layouts.

Free 30k+ installs 4.6★ (106)
Seriously Simple Podcasting

Podcasting the way it's meant to be. No mess, no fuss - just you and your content taking over the world.

Free 30k+ installs 4.7★ (329)
Hide Posts

Hide posts or WooCommerce products from the homepage, archives, search, RSS, REST API, sitemaps and SEO tools...

Free 20k+ installs 4.7★ (22)