WebberZone Code Block Highlighting supports two rendering modes: client-side (Prism.js in the browser) and server-side (highlight.php on the server). The mode is set globally and applies to all code blocks on the site.
Client-side mode (default)
Prism.jsOpens in a new window loads in the visitor’s browser and highlights the code on page load. The Prism JS bundle (containing all bundled grammars and plugins) and the active theme CSS are enqueued on pages that contain at least one code block. Interactive toolbar features — copy-to-clipboard, expand/collapse, and the language label — are all available in this mode.
Server-side mode
highlight.phpOpens in a new window runs during WordPress page rendering and pre-bakes the highlighted token spans directly into the HTML. No Prism.js is loaded — syntax highlighting runs entirely on the server. The active Prism theme CSS, frontend.css, hljs-server-mode.css, and a lightweight script (hljs-clipboard.js) for copy-to-clipboard and expand/collapse are enqueued.
This mode is suitable for:
- Performance-focused setups that want to avoid loading Prism.js
- Sites with strict content-security policies that restrict inline scripts
- AMP-compatible pages
The Highlight Lines per-block control has no effect in server-side mode.
Large code blocks
highlight.php slows sharply as a block grows, and that work runs while the page is built. Blocks larger than 128KB are rendered as plain text in the active theme rather than highlighted. Use the wzcbh_server_highlight_max_bytesOpens in a new window filter to change the limit, or set it to 0 to disable server-side highlighting entirely. Client-side mode is unaffected.
Visual output
Both modes load the same 21 Prism themes and produce visually identical output. The plugin remaps the token class names emitted by highlight.php to match Prism’s class conventions, so the same theme CSS applies correctly in both modes. You can switch modes at any time from Settings > Code Block Highlighting without any visible change to your code blocks, apart from blocks over the server-side size limit described above.
Asset loading
In both modes, assets are only enqueued on pages that contain at least one core/code block. Pages without code blocks are not affected. Use the wzcbh_force_load_assetsOpens in a new window filter to override this behavior if needed.
- Client mode:
frontend.css+ Prism theme CSS +wzcbh-prism-js(Prism bundle with all grammars and plugins) - Server mode:
frontend.css+ Prism theme CSS +hljs-server-mode.css+hljs-clipboard.js(copy-to-clipboard and expand/collapse)
Switching modes
Go to Settings > Code Block Highlighting and change Highlighting Mode to either Client-side (Prism.js) or Server-side (highlight.php). No other configuration is required.

