Description
The Code Snippets Extension add-on adds to the MainWP panel an area to create, store, and run code snippets on selected child sites, allowing you to apply PHP tweaks, theme functions, or small automations without accessing each installation separately. In the maintenance workflow of WordPress networks, this extension centralizes recurring interventions and helps administrators test, reuse, and distribute controlled snippets with less screen switching.
Key Features
- Snippet library
Stores reusable code snippets within the MainWP panel. - Execution on child sites
Applies snippets to the connected sites chosen by the administrator. - Centralized management
Organizes technical adjustments without switching between multiple WordPress panels. - PHP workflow
Allows inserting functions and small adjustments compatible with WordPress. - Selection-based control
Directs each snippet only to the sites defined in the action.
Benefits of the Code Snippets Extension
- Less repetitive work
Reduces manual access across WordPress installations managed in bulk. - Technical standardization
Helps keep the same adjustments across different network sites. - Faster maintenance
Makes targeted fixes easier without editing files via FTP. - More controlled operation
Allows applying changes only to the sites that truly need them.
Who Is It For?
- Agencies that manage multiple WordPress sites through MainWP.
- Developers who reuse small code tweaks across different clients.
- Technical administrators who need to apply snippets without accessing each site individually.
Code Snippets Extension fits into maintenance routines where small functions, fixes, and adjustments need to be replicated with criteria. The component adds a practical layer to MainWP for handling recurring code snippets, keeping operations centralized and reducing the time spent on repeated tasks within each WordPress installation.
Frequently asked questions
Is MainWP Code Snippets Extension GPL-licensed?
Yes. MainWP Code Snippets Extension is distributed under the GPL (GNU General Public License). You may legally use, modify and redistribute it on as many sites as you want.
Can I use MainWP Code Snippets Extension on multiple sites?
Yes. You can install MainWP Code Snippets Extension on as many sites as you want. Only automatic updates through Ultrapack Auto Updater have a limit: from 3 to 80 sites, depending on the plan.
How much does MainWP Code Snippets Extension cost at Ultrapack?
MainWP Code Snippets Extension costs US$2.99 as a single purchase, and it is also included in the subscription plans starting at US$12/mo (VIP I).
Does MainWP Code Snippets Extension include updates?
Yes. The current version of MainWP Code Snippets Extension is 5.1.1, published at Ultrapack on Jun 17, 2026. Subscribers update straight from the WordPress dashboard with UAU (Ultrapack Auto Updater).
Is MainWP Code Snippets Extension scanned before publication?
Yes. Every version of MainWP Code Snippets Extension goes through a malware scan (ClamAV and YARA rules, at UltraHub) before it is published.
What changed in this version
Version 5.1.1
- Fixed: Corrected the Code Snippets table installer to always define the auto-increment ID as a primary key.
Version 5.1
- Security: Improved code snippet database handling with prepared queries, sanitized values, and stricter user scoping.
- Security: Strengthened AJAX input and output handling to improve protection against malformed or unsafe requests.
- Fixed: Corrected formatting of default snippet code.
- Fixed: Ensured default snippet descriptions and data are properly migrated during upgrades.
- Added: Code folding UI and fold keymap support.
- Added: Autocompletion and automatic bracket closing in the code editor.
- Added: Natural Tab indentation support in the code editor.
- Added: PHP pre-save syntax validation to help catch common syntax errors before saving snippets.
- Added: Added a new clients column to the Code Snippets database table to support client-based snippet organization.
- Updated: Reworked the snippet editor layout with a cleaner, more modern interface.
- Updated: Moved snippet settings above the code editor for easier access while editing snippets.
- Updated: Compacted snippet action buttons to reduce visual clutter in the editor area.
- Updated: Replaced the snippet type radio buttons with a pill-style selector for a clearer editing experience.
- Updated: Improved the saved snippets table by combining snippet titles and descriptions into a single, more readable column.
- Updated: Replaced plain text snippet type indicators with colored labels for better visibility in the saved snippets table.
- Updated: Refined multiple text strings for clearer and more consistent wording.
- Updated: Improved snippet options handling, selection normalization, and snippet type validation for better reliability.
- Updated: Improved snippet run UI rendering for a cleaner and more consistent user experience.
- Updated: Replaced the legacy CodeMirror 5 editor with a new CodeMirror 6 bundle.
- Updated: Improved internal utility handling with a safer rand_string method and a more user-friendly time_elapsed_string helper.
- Dev: Refactored core database methods, including install, update_codesnippet, get_codesnippet_by, and remove_codesnippet, for safer and more consistent data handling.
- Dev: Refactored the extension structure with clearer return semantics, improved docblocks, singleton patterns, and updated build files for better maintainability.
Version 5.0.4
- Fixed: An issue with saving the snippets table state.
- Added: Localization support.
- Updated: Removed excessive navigation menu on the extension page.
Version 5.0.3
- Fixed: An issue with sorting snippets table by the last modified date
Version 5.0.2
- Fixed: An issue with saving new snippets duplicates
Release notes published by the developer.
How to install
Automatic updates: this item is updated by the Ultrapack Auto Updater. With it installed, the new version shows up in your dashboard like any other WordPress update (how to set it up).
- Download the file
mainwp-code-snippets-extension.zip. - In the WordPress dashboard, go to Plugins > Add New > Upload Plugin.
- Select the file
mainwp-code-snippets-extension.zipand click Install Now. - Click Activate.
Stuck on a step? Open a ticket telling us which one you stopped at.

UAU Ready