plugin-icon

WebberZone Code Block Highlighting

作者:Ajay·
Add beautiful syntax highlighting to the Gutenberg Code block — powered by Prism.js with 21 themes and 40 languages, zero configuration required.
版本
1.0.0
最后更新
May 3, 2026
WebberZone Code Block Highlighting

WebberZone Code Block Highlighting is the easiest way to add syntax highlighting to your WordPress site. It extends the native Gutenberg core/code block with Prism.js highlighting — no shortcodes, no block replacement, no risk of breaking existing posts.

Simply activate the plugin and your code blocks will instantly display beautiful, readable syntax highlighting on the frontend. Choose from 35+ programming languages and 21 colour themes, all controlled from the block editor’s Inspector Controls sidebar.

Why use this plugin?

  • Safe by design — Works as a filter on top of core/code. Existing posts are never invalidated. Deactivate the plugin and your blocks are still valid standard WordPress code blocks.
  • Zero configuration — Activate and start writing. No setup wizard, no shortcodes.
  • Smart asset loading — Prism CSS and JS only load on pages that actually contain code blocks. Pages without code stay fast.
  • Per-block controls — Set language, theme, line numbers, word wrap, title, highlighted lines, and max height individually for each block.
  • Developer-friendly — Filters to add languages, override themes, and force asset loading.

Supported languages

40 languages including: Apache Config, Bash, C, C++, C#, CSS, Dart, Docker, F#, Go, GraphQL, Groovy, Haskell, HTML, Java, JavaScript, JSON, JSX, Kotlin, Lua, Markdown, Nginx, Objective-C, Perl, PHP, PowerShell, Python, R, Ruby, Rust, Sass, Scala, SQL, Swift, TOML, TSX, TypeScript, Vim, XML, YAML. Use the wzcbh_languages filter to add or remove entries from the language picker.

Included themes (21)

A11y Dark, Coldark Cold (Light), Coldark Dark, Dracula, Duotone Dark, Duotone Light, GitHub (Light), Gruvbox Dark, Gruvbox Light, Lucario, Material Dark, Material Light, Night Owl, Nord, One Dark, One Light, Shades of Purple, Solarized Dark, Synthwave ’84, VS Code Dark+, Xonokai (Monokai).

Per-block features

  • Language selector — Choose the programming language from the sidebar; applies the correct Prism grammar automatically.
  • Line numbers — Toggle line numbers per block, with a configurable start line.
  • File title / label — Add an optional filename or label displayed in the code block toolbar.
  • Highlight lines — Specify lines or ranges (e.g. 1,3-5) to visually highlight using Prism’s line-highlight plugin.
  • Max height with expand/collapse — Set a maximum height in pixels; an expand/collapse toolbar button appears automatically.
  • Word wrap — Toggle soft word wrapping per block.

Global settings

  • Default colour scheme (theme)
  • Default language
  • Default line numbers toggle and start value
  • Default word wrap
  • Copy-to-clipboard button
  • Show language label in toolbar
  • Font size

Developer filters

  • wzcbh_languages — Filter the language list array (slug => label)
  • wzcbh_color_scheme_css_url — Override the Prism theme CSS URL
  • wzcbh_force_load_assets — Force Prism assets to load on every page

GDPR

WebberZone Code Block Highlighting does not collect personal data, set cookies, or communicate with any external services.

Contribute

The plugin is open source and available on GitHub. Pull requests for bug fixes and new features are welcome. Please use the WordPress.org support forum for support and GitHub Issues for confirmed bug reports.

Translations

Help translate WebberZone Code Block Highlighting into your language on WordPress.org. See the Translator Handbook for guidance.

Other plugins by WebberZone

  • Contextual Related Posts — Display fast, intelligent related posts to keep visitors on your site longer
  • Top 10 — Track daily and total visits and display popular and trending posts
  • WebberZone Snippetz — Manage custom HTML, CSS and JS snippets across your site
  • Knowledge Base — Create a knowledge base or FAQ section on your WordPress site
  • Better Search — Contextual search results sorted by relevance
  • Auto-Close — Automatically close comments, pingbacks, trackbacks and manage revisions
  • Popular Authors — Display popular authors in a WordPress widget
  • Followed Posts — Show related posts based on what your visitors have already read
  • WebberZone Link Warnings — Add accessible warnings for external links and target=”_blank” links
免费基于付费套餐
通过安装,您同意 WordPress.com 服务条款第三方插件条款
目前已测试版本
WordPress 7.0
这个插件是可用的下载,适用于您的站点。