Init Code Inserter – A plugin for inserting code into WordPress comments, with PrismJS support

Version: 1.0 Tiếng Việt

Init Code Inserter – A plugin for inserting code into WordPress comments, with PrismJS support
Init Code Inserter is a free plugin that helps you easily insert code snippets into WordPress comments, featuring a modern interface and PrismJS support. It's designed to be flexible and suitable for any tech blog or developer community website.

Key Features

  • Add a “Insert Code” button directly inside the comment area.
  • A code input modal with programming language selection.
  • Generates shortcode format: [code lang="..."]...[/code].
  • Automatically loads PrismJS if it’s not already included in your theme.
  • Supports both English and Vietnamese interfaces.
  • Supports dark mode: Can be enabled via the dark class or configured using the window.initPluginSuiteCodeInserterConfig.theme variable with values 'light', 'dark', or 'auto' before the plugin initializes.

How it works

Once the plugin is activated, you’ll see an “Insert Code” button in the comment area. When users click it, a modal will appear allowing them to input the code they want to share, choose a programming language, and insert it into their comment.

For example, a user enters the following JavaScript code:

[code lang="javascript"]console.log("Hello world!");[/code]

The plugin will automatically render the code with syntax highlighting using PrismJS:

console.log("Hello world!");

You can try this feature right away by leaving a comment below! Click the Insert Code button to add code to your comment.

Installation Guide

  1. Download the plugin from the official page (this one).
  2. Unzip it and upload to the /wp-content/plugins/ directory.
  3. Go to your WordPress admin > Plugins > Activate Init Code Inserter.
  4. Visit a post with comments to try the Insert Code button.

Why use this plugin?

For tech blogs or community sites, inserting code in comments can often break formatting or look messy. Init Code Inserter helps:

  • Ensure clean and beautiful formatting for code snippets.
  • Avoid HTML errors when users paste raw code directly into the comment box.
  • Make the comment section easier to read, easier to discuss, and more professional.

Code insertion modal in the comment section

With Init Code Inserter, users can easily insert code snippets directly into comments with just one click.

Code insertion modal interface in the comment box


Code insertion modal interface in the comment box.

Support

For feedback, bug reports, or feature requests, please leave a comment on this post.

Init Code Inserter is a lightweight yet extremely useful tool that helps keep your blog comments clean, properly formatted, and provides a better experience for code-loving users.

Review

5.0/5 (1)

Changelog

  • 1.0 – Initial Release

    • Added the ability to insert code into the comment area using an easy-to-use input modal.
    • Supports shortcode formatting for source code, allowing users to easily embed code using the syntax [code lang="..."]...[/code].
    • Syntax highlighting powered by PrismJS. If PrismJS is not already loaded, the plugin will detect and include it automatically.
    • Allows setting light, dark, auto mode using the window.initPluginSuiteCodeInserterConfig.theme variable before the plugin initializes.
    • Supports two languages: English and Vietnamese, providing a better user experience for both communities.
Made with in HCMC.

Comments


  • No comments yet.

Init Toolbox

Press Ctrl + \ on desktop, or swipe left anywhere on mobile.

Login