Add code block with syntax highlighting using prism.js. (Available for Gutenberg and Classic Editor)
As of April 2026, Highlighting Code Block is a WordPress code plugin with 10K+ active installations and a 4.5/5 rating from 19 reviews. It has been downloaded 170K+ times in total. Requires WordPress 5.6+ and PHP 5.6+. Available on WordPress.org since 2018. Actively maintained — updated within the last month. Downloads are up 9016% this week. Top alternative: WPCode – Insert Headers and Footers +….
“Highlighting Code Block” allows you to add a syntax-highlighted code block with just a click.
It supports both “Block Editor” and “Classic Editor”.
(However, we recommend using it in the “Block Editor”.)
Please see the following page for a detailed explanation of this plugin.
URL: https://loos.co.jp/en/documents/highlighting-code-block/
The source code of this plugin is available on Github.
URL: https://github.com/ddryo/Highlighting-Code-Block
在寻求关于此问题的帮助时,您可能需要提供以下信息:
WordPress 版本 6.5.2
目前启用的主题:Vikinger – BuddyPress Social Community(1.9.9.4.2 版本)
当前插件:Highlighting Code Block(版本 2.0.1)
PHP 版本 8.1.27
错误详情
============
错误类型 E_ERROR 发生在文件 /www/wwwroot/1.14.58.204/wp-content/plugins/highlighting-code-block/class/loos_hcb_menu.php 的 140 行。错误信息:Uncaught ValueError: Unknown format specifier “�” in /www/wwwroot/1.14.58.204/wp-content/plugins/highlighting-code-block/class/loos_hcb_menu.php:140
Stack trace:
#0 /www/wwwroot/1.14.58.204/wp-content/plugins/highlighting-code-block/class/loos_hcb_menu.php(140): sprintf()
#1 /www/wwwroot/1.14.58.204/wp-includes/class-wp-hook.php(324): {closure}()
#2 /www/wwwroot/1.14.58.204/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#3 /www/wwwroot/1.14.58.204/wp-includes/plugin.php(517): WP_Hook->do_action()
#4 /www/wwwroot/1.14.58.204/wp-admin/admin.php(175): do_action()
#5 /www/wwwroot/1.14.58.204/wp-admin/plugins.php(10): require_once(‘…’)
#6 {main}
thrown
read code easily
Very thanks!
Unfortunately, the plugin doesn’t support Java, Kotlin, Flutter nor XML syntax, making it completely useless for anyone in the Android development field.
I don’t normally use WP Blocks and so I could not figure out why this plugin broke for certain code syntax (PHP -> HTML -> PHP for example) and why saving sometimes broke the previously-saved syntax. Maddening. Then I switched back to the block editor. AHA! It works beautifully. That’s probably why it says “Block” in the plugin name, duh. Thank you very much for this wonderful plugin. I love that we can also upload our own prism.js files. Cool.
| WordPress | 5.6+ requiredTested up to 6.9.4 |
| PHP | 5.6+ required |
Plugin data sourced from WordPress.org. Analysis and metrics by PluginSift.