Highlighting Code Block


“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/

Source code

The source code of this plugin is available on Github.

URL: https://github.com/ddryo/Highlighting-Code-Block

How to use

How to use (For Block Editor)

  • Open the “Formatting” category of the Block Inserter.
  • There is a custom block named “Highlighing Code Block”.
  • Select it, the block will be inserted.
  • Select the language of the code and enter any code.

How to use (For Classic Editor)

  • You should see a select box labeled “Code Block” on the toolbar (2nd row by default).
  • When you select a language from the select box, a code block (pre tag) is inserted.

If it doesn’t work

This plugin works only with PHP version 5.6 or later, WordPress 5.6 or later.
Please check your PHP version or WordPress version.

About settings

The menu “[HCB] Settings” should be added to “Settings” in the left menu of the management screen.
Settings related to this plugin are set in this menu.


  • Code Coloring
  • Select 「Highlighing Code Block
  • Select lang (Guternberg)
  • Writing your code (Guternberg)
  • Added select box (Tinymce)
  • Select lang (Tinymce)
  • Writing your code (Tinymce)
  • ex) Light color
  • ex) Dark color
  • Base Setting
  • Higher Setting


This plugin provides 1 block.

  • Highlighing Code Block


This plugin can be installed directly from your site.

  1. Log in and navigate to “Plugins” “Add New”.
  2. Type “Highlighting Code Block” in the search field and press Enter.
  3. Locate the plugin in the list of search results and click “Install Now”.
  4. Once installed, click the “Activate” button.


Available languages

The following languages are available by default.

  • HTML
  • CSS
  • SCSS
  • JavaScript
  • TypeScript
  • PHP
  • Ruby
  • Python
  • Swift
  • C
  • C#
  • C++
  • Objective-C
  • SQL
  • JSON
  • Bash
  • Git


Yuli 15, 2024
편집기와 미리보기 결과가 불일치 편집기에서 줄번호 비정상 표시 줄번호와 코드 영역 겹침
Aprailu 14, 2024
在寻求关于此问题的帮助时,您可能需要提供以下信息:WordPress 版本 6.5.2目前启用的主题:Vikinger – BuddyPress Social Community( 版本)当前插件:Highlighting Code Block(版本 2.0.1)PHP 版本 8.1.27 错误详情============错误类型 E_ERROR 发生在文件 /www/wwwroot/ 的 140 行。错误信息:Uncaught ValueError: Unknown format specifier “�” in /www/wwwroot/ trace:#0 /www/wwwroot/ sprintf()#1 /www/wwwroot/ {closure}()#2 /www/wwwroot/ WP_Hook->apply_filters()#3 /www/wwwroot/ WP_Hook->do_action()#4 /www/wwwroot/ do_action()#5 /www/wwwroot/ require_once(‘…’)#6 {main}thrown
Nuwamba 4, 2023 1 reply
Unfortunately, the plugin doesn’t support Java, Kotlin, Flutter nor XML syntax, making it completely useless for anyone in the Android development field.
Yuli 25, 2023
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.
Read all 21 reviews

Contributors & Developers

“Highlighting Code Block” is open source software. The following people have contributed to this plugin.


“Highlighting Code Block” has been translated into 4 locales. Thank you to the translators for their contributions.

Translate “Highlighting Code Block” into your language.

Interested in development?

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



  • Some text of setting items has been changed.


  • Support for WordPress 6.4.
  • Support for PHP 8.2.
  • The CSS and Block UI have been significantly adjusted.
  • CSS custom properties have also been renamed and cleaned up overall.
  • Added data-start attribute settings to blocks.


  • Support for WordPress 6.2.
  • The style loading process has been fine-tuned.
  • Added aria-label to the Copy Code button.


  • Support for WordPress 6.1.


  • Support for WordPress 6.0.


  • Fixed the version number.



  • Fixed a bug.


  • Fixed the problem of misaligned lines in some themes.


  • Fixed a bug.


  • Support for WordPress 5.9.
  • Refactored the CSS.


  • Fixed a bug where changing the settings in the languages list did not change the choices in the block.


  • Fixed a bug that amplified the class of the block.
  • Fixed a bug that caused clipboard.js to be loaded even when it was not needed.


  • Support for WordPress 5.8.
  • Required WordPress version raised to 5.6.


  • Fixed a bug that the number of lines is not displayed.


  • Support for WordPress 5.7.
  • Fixed spelling mistakes. (“plane” to “plain”)
  • Code fixes.


  • Added copy button function.
  • Code refactoring.
  • Support for WordPress 5.6.


Fixed file icon 404 error.


  • Made the code lighter.
  • Changed handle name of CSS and JS.


Fixed register block.


Fixed block.json file.


  • Adjustments for registering “block libraries”.
  • Abolished the block width adjustment function.
  • Abolished the ability to remove “br” tag from the “code” tag.


Change the code to register the script.


  • Fixed a bug that CSS cannot be read depending on the server.
  • It is now possible to set whether to display the language name for each block.
  • Even if the language name is set to hidden, it will be displayed if the file name is entered.
  • You can now preview the display of language names and file names in the block editor.


Fixed translation file.


Fixed translation file.


English is supported.


  • Compatible with WordPress5.3.
  • Deleted the left and right margins of the HCB code block, and left it to the theme.
  • Enabled conversion with core “source code block”.


  • Compress CSS file to read.
  • Changed to load some CSS with style tag in head.
  • Fixed a bug that font family settings were not reflected.
  • Code cleanup for CSS and JS


  • Move reading script to wp_footer.
  • Changed HCB block logo.
  • You can now set font-family for code blocks.


  • Support for WordPress 5.2.1
  • Changed font-family of code block.
  • The file name can be set to the code block.


Support for WordPress 5.1.1


Change readme.txt


Comment delete.


Initial release.