BACK TO DIRECTORY

Code Block – share beautiful code snippets readers can copy

by bPlugins

0.0
(0 ratings)

Turn plain code into beautifully highlighted, copy-ready snippets your readers will love – right inside the Gutenberg editor.

Code Snippets Block | Pricing | Support | Live Demos

What Is Code Snippets Block?

Code Snippets Block is a lightweight WordPress code block plugin for displaying programming code with syntax highlighting, copy-to-clipboard functionality, responsive layouts, and multiple visual themes.

Add clean and readable code examples to WordPress posts, pages, documentation, tutorials, developer portfolios, knowledge bases, and technical websites without writing custom code.

The plugin works directly with the WordPress Gutenberg Block Editor and supports popular programming languages including PHP, JavaScript, Python, HTML, CSS, JSON, and SQL.

Why Use Code Snippets Block?

Publishing code in a normal text editor can make technical content difficult to read and copy. Code Snippets Block turns your code into a structured, highlighted, and copy-ready code block.

It is useful for developers, technical writers, educators, bloggers, documentation creators, agencies, and anyone publishing programming content with WordPress.

Free Features

  • One-Click Copy Button: Readers copy the entire snippet to their clipboard in a single click, with customizable text/icon.
  • Multiple Syntax Themes: Choose from pre-styled themes (like Dark, Midnight, and Light) to match your website design.
  • Syntax Highlighting: Improve readability for all major languages – PHP, JavaScript, Python, HTML, CSS, and more.
  • Responsive Code Views: Snippets wrap and resize smoothly on mobile, tablet, and desktop.
  • Shortcode Support: Embed code snippets anywhere on your site.
  • Dedicated Block Category: All blocks are grouped under a “Code” category in the Gutenberg inserter for easy access.
  • Optimized & Lightweight: Assets load only when a block is on the page, with minimal impact on page speed.

Pro Version

Upgrade to Pro to unlock a suite of 16 interactive developer blocks:

  • Run Python (WASM): A live Python interpreter powered by Pyodide (WebAssembly) that runs in the reader’s browser – no server-side execution, lazy-loaded for speed.
  • Code Screencast (Self-Typing): Animated, character-by-character typing walkthroughs.
  • JSON Explorer: Interactive, collapsible, searchable JSON tree views with match-highlighting and copy-path tools.
  • Regex Tester: A live regular-expression sandbox with highlighted match output.
  • Spotlight Code: Walk readers through specific lines by dimming or blurring the rest, with captioned steps.
  • Code Snapshot: Turn snippets into mockup graphics with window chrome, gradients, and shadows – download as PNG or copy image.
  • API Try-It Console: A functional HTTP/REST client block for live requests with timing, status, and formatted responses.
  • Annotated Code: Clickable badges on specific lines that reveal detailed explanations.
  • AI Code Explainer: Generate plain-English explanations using OpenAI or Anthropic inside the editor.
  • Diagram as Code: Write Mermaid text and render flowcharts, sequence diagrams, class diagrams, Gantt charts, and pie charts.
  • Live Code Playground: An HTML/CSS/JS sandbox in a secure iframe with instant visual previews.
  • Code Diff / Comparison: Highlight added/removed lines in Unified or Split view.
  • Multi-Tab Code Switcher: Organize snippets under tabs (e.g. npm vs yarn, or JavaScript vs PHP).
  • Terminal / Command Line: A styled shell emulator with typing animations and one-click copy of commands.
  • Remote Code Embed: Fetch code from GitHub Gists, raw files, or CodePen pens, styled in your own theme.
  • Advanced Code Block Styling: Custom colors, font sizes, paddings, borders, shadows, alignment, and line numbering.

Use Cases

  • Programming Tutorials: Make your snippets easy to read and copy.
  • Developer Documentation: Keep code examples clean and consistent.
  • Developer Portfolios: Showcase your clean code with pride.
  • Technical Knowledge Bases: Present reference code in a professional format.
  • Educational Coding Resources: Help students follow along and copy examples.

What Can You Do With Code Snippets Block?

Code Snippets Block helps you publish programming and developer content directly in WordPress.

You can use it to:

  • Add syntax-highlighted code to WordPress posts and pages.
  • Create copyable programming examples.
  • Publish coding tutorials.
  • Build developer documentation.
  • Create technical knowledge bases.
  • Display API examples.
  • Present JSON data.
  • Compare different versions of code.
  • Create interactive HTML, CSS, and JavaScript examples.
  • Explain programming code with AI.
  • Create developer-focused portfolio pages.

Syntax Highlighting

Display programming code with syntax highlighting to make code easier to read and understand.

Supports popular languages including:

  • PHP
  • JavaScript
  • Python
  • HTML
  • CSS
  • JSON
  • SQL
  • And more

One-Click Copy Code

Add a copy button so visitors can copy an entire code snippet to their clipboard with one click. The copy button text and icon can be customized from the block settings.

Who Is Code Snippets Block For?

Code Snippets Block is designed for:

  • WordPress developers
  • Web developers
  • Programming bloggers
  • Technical writers
  • Documentation teams
  • Online educators
  • Coding tutorial creators
  • Developer portfolio owners
  • Software agencies
  • Technical knowledge-base websites

Diagram as Code

Write Mermaid syntax and display diagrams such as:

  • Flowcharts
  • Sequence diagrams
  • Class diagrams
  • Gantt charts
  • Pie charts

Live Code Playground

Create interactive HTML, CSS, and JavaScript examples inside a secure iframe with live previews.

Code Diff

Compare two versions of code using unified or split comparison views.

Multi-Tab Code Switcher

Organize multiple code examples inside tabs, such as:

  • JavaScript / PHP
  • npm / yarn
  • HTML / CSS
  • Before / After

Advanced Code Styling

Customize code presentation with advanced styling options such as:

  • Colors
  • Font sizes
  • Padding
  • Borders
  • Shadows
  • Alignment
  • Line numbers

How to Use

  1. Install and activate the Code Snippets Block plugin.
  2. In the Gutenberg editor, add the Code Snippets block.
  3. Paste your code and pick a syntax theme.
  4. Adjust settings from the right-side settings sidebar.
  5. Publish – your highlighted, copy-ready snippet is live!

How to Add Code with Shortcode

Code Snippets Block also supports shortcode-based embedding.

  1. Create your code snippet.
  2. Copy the generated shortcode.
  3. Paste the shortcode into a shortcode-supported area.
  4. Save or publish the page.

This allows you to display code snippets in different areas of your WordPress website.

Liked this plugin? Want a new feature? Send us some feedback.

⭐ Check out the Parent Plugin of this plugin-

🔥 b Blocks – Best gutenberg blocks collections for WordPress.

⭐ Check out our other WordPress Plugins-

🔥 Html5 Audio Player – Best audio player plugin for WordPress.

🔥 Html5 Video Player – Best video player plugin for WordPress.

🔥 PDF Poster – A fully-featured PDF Viewer Plugin for WordPress.

🔥 StreamCast – A fully-featured Radio Player Plugin for WordPress.

🔥 3D Viewer – Display interactive 3D models on the webs.

Screenshots

Code Snippets Admin Dashboard

Code Snippets Admin Dashboard

Add New FAQ (ShortCode)

Add New FAQ (ShortCode)

Default Theme

Default Theme

Dark Theme

Dark Theme

Tomorrow Theme

Tomorrow Theme

Solarized Light Theme

Solarized Light Theme

Twilight Theme

Twilight Theme

Porple Theme

Porple Theme

White Theme

White Theme

Github Theme

Github Theme

Gradient-Light Theme

Gradient-Light Theme

VSCode-Dark Theme

VSCode-Dark Theme

Codepan Embeb Theme

Codepan Embeb Theme

Far Theme

Far Theme

Gutenberg Block Support

Gutenberg Block Support

Gutenberg Block Settings

Gutenberg Block Settings

Plugin Details

Active Installs
200
Total Downloads
5,664
Version
1.1.5
Requires WP
6.5
Requires PHP
7.4
Tested Up To
7.1
Added
2025-04-22
Last Updated
2026-09-10 11:19am GMT

Ratings

5
0
4
0
3
0
2
0
1
0