Modern, lightweight syntax highlighter for WordPress using Highlight.js with support for multiple languages, themes, copy-to-clipboard functionality, and Gutenberg integration.
- Modern Highlight.js Engine: Uses the latest Highlight.js library for fast, accurate syntax highlighting
- 80+ Themes Included: Over 80 themes for both light and dark modes, all stored locally for offline compatibility
- Visual Theme Selector: Clean admin interface with grid layout for easy theme selection
- Wide Language Support: Supports 20+ programming languages including JavaScript, PHP, Python, CSS, HTML, SQL, Bash, and more
- TinyMCE Integration: Adds a button to the classic editor for easily inserting code blocks
- Copy to Clipboard: Double-click any code block to instantly copy its content with localized feedback messages
- Performance Optimized: Smart asset loading—only loads when needed
- Responsive Design: Works beautifully on all devices
- Security Focused: Proper input sanitization and output escaping
- Localization Ready: Translation-ready with proper text domains
- Gutenberg Integration: Seamless integration with the block editor
- WordPress: 5.0+
- PHP: 7.0+
- MySQL: 5.6+
- Download and extract the plugin files
- Upload the
easy-syntax-highlighterfolder towp-content/plugins/ - Activate the plugin through WordPress admin → Plugins
- Go to Settings → Syntax Highlighter to configure options
- Start using the syntax highlighter in your posts and pages
- After activation, the plugin automatically highlights code in the default Gutenberg "Code" block.
- In the Gutenberg editor, add a "Code" block.
- Paste your code into the block.
- In the block settings panel on the right, specify the language for your code (e.g.,
javascript,php). - Publish and enjoy beautiful syntax highlighting on your website's frontend.
This plugin works by automatically applying syntax highlighting to the default WordPress "Code" block.
- Click the
+button and add a "Code" block. - Paste your code into the block.
- The plugin will automatically detect the language on the front end of your website.
Forcing a specific language (Advanced): If the automatic detection is not correct, you can manually specify a language:
- Select the Code block.
- Click the three-dot menu in the block's toolbar and choose "Edit as HTML".
- Find the
<code>tag and add a class with the language name, like this:<code class="language-javascript">. - Click "Edit visually" to return to the normal view.
- Use the TinyMCE button (code icon) in the editor toolbar to open the code insertion modal.
- Paste your code, select the language from the dropdown, and click "Insert".
- Theme Selection: Choose from over 80 different color themes using a visual theme selector
- Language Support: Automatic language detection or manual selection
- Copy to Clipboard: Double-click any code block to copy (enabled by default)
- Performance: Assets only load when code blocks are present
- Security: Proper input sanitization and validation
- Accessibility: Screen reader friendly with proper ARIA labels
Located in Settings → Syntax Highlighter:
The settings page includes quick access buttons to the WordPress.org plugin page and GitHub repository for support and updates.
- Theme Selection: Visual grid layout with live previews for all 80+ themes
- Language Settings: Configure supported languages and auto-detection
- Performance Options: Control asset loading and caching
- Copy Functionality: Enable/disable double-click to copy feature
The plugin includes popular themes like:
- GitHub (Light/Dark)
- Monokai
- Atom One (Light/Dark)
- VS Code
- Dracula
- And 70+ more...
- Check Block Type: Ensure you're using the correct Gutenberg block or shortcode
- Language Selection: Verify the correct programming language is selected
- Theme Loading: Check browser console for CSS loading errors
- Plugin Updates: Ensure the plugin is updated to the latest version
- Asset Loading: The plugin only loads assets when code blocks are present
- Caching: Clear any caching plugins if themes don't update
- Browser Cache: Hard refresh (Ctrl+F5) to clear browser cache
- JavaScript Enabled: Ensure JavaScript is enabled in your browser
- Console Errors: Check browser developer tools for JavaScript errors
- Double-click: Make sure to double-click directly on the code block
- Theme Selection: Verify theme is selected in settings
- CSS Loading: Check if theme CSS files are accessible
- Cache Clearing: Clear WordPress and browser caches
Licensed under the GNU General Public License v2.0 or later.
Copyright (C) 2025 snowbedding
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
Made with ❤️ for the WordPress community