

MainWP Code Snippets
MainWP Code Snippets by MainWP is an extension for the MainWP Dashboard. It lets you add, save and run custom PHP code snippets on your connected child sites from one place, so you no longer edit theme files or wp-config.php on each site by hand.
- Version
- 5.1.1
- Released
- Jun 16, 2026
- Developer
- MainWP
- Type
- WordPress plugin
- Requires
- MainWP
- Licence
- GPL
- Included in
- Every plan, or $4.79 a year on its own
What’s new in MainWP Code Snippets 5.1.1
- FixedCorrected the Code Snippets table installer to always define the auto-increment ID as a primary key.
What it does
If you manage a lot of WordPress sites, small code changes add up fast. Adding a function to one theme file is easy, but repeating it across dozens of child sites means logging into each one, editing files and hoping nothing gets missed. This extension moves that work into the MainWP Dashboard. You write a PHP snippet once, choose the sites it should run on, and execute it on all of them at the same time.
Snippets can do several kinds of jobs. You can run code directly on child sites, pull back data such as post counts, or change wp-config.php remotely. Many people use it for hardening, like disabling the theme and plugin editors or blocking core updates, and for routine upkeep such as clearing trash or creating redirections. It requires the MainWP plugin, and running new code on a test site before going live is recommended.
Best for
- Agencies maintaining many client WordPress sites
- Developers already managing sites through MainWP
- Site managers applying security hardening across a network
Features
Add, edit and manage PHP snippets for all your child sites from the MainWP Dashboard instead of switching between individual site admin areas.
Execute a snippet across multiple child sites at the same time to keep functionality consistent throughout the sites you manage.
Use snippets to pull information back from child sites, such as post counts, without logging into each site separately.
Modify wp-config.php files on child sites from the dashboard, which saves you from opening each site's configuration file by hand.
Disable theme and plugin editors, block unwanted core updates, adjust auto-save intervals and prevent external HTTP requests using snippets.
Store the snippets you use often so you can deploy the same code to other sites later and keep your setup consistent.
Update plugin configurations and widgets across your managed sites with snippets, cutting down on repetitive manual changes on each site.
Treat snippets like small plugins to clean up trash, update settings or create redirections without installing extra plugins on every site.
MainWP Code Snippets older versions
- 5.1Jun 105 new, 13 improvements, 2 fixes, 2 security fixes
- 5.0.4Nov 29, 20241 new, 1 improvement, 1 fix
- 5.0.3Jun 26, 20241 fix
- 5.0.2Jun 19, 2024
- 5.0.1May 29, 2024
- 5.0Feb 29, 2024
- 4.0.3Apr 18, 2023
Members and buyers of this product can download older versions.
Questions about MainWP Code Snippets
Do I need MainWP to use this extension?
Yes. MainWP Code Snippets works as an extension of the MainWP Dashboard and requires the MainWP plugin. Snippets are written and run from the dashboard and applied to the child sites connected to it.
Can I run one snippet on several sites at the same time?
Yes. You can pick multiple child sites and execute a snippet on all of them simultaneously. This is useful for applying the same function, setting change or hardening rule across your whole group of sites.
What kinds of tasks can snippets handle?
Snippets can run functions on child sites, retrieve data like post counts, and modify wp-config.php remotely. Common uses include disabling theme and plugin editors, blocking core updates, adjusting auto-save intervals, cleaning up trash, creating redirections and syncing plugin settings or widgets.
Is it safe to run custom code on live sites?
Custom PHP can affect a site if it contains errors, so running every snippet on a test site before rolling it out to live sites is recommended. Testing first helps you catch problems and reduce the risk of downtime.
Is MainWP Code Snippets free?
The code of MainWP Code Snippets is licensed under the GPL, so anyone may use, change and share it. GPL Feast is a paid service: a plan or a single purchase gives you the download and automatic updates. The developer's own support, licence key and online services are not included.
Which version of MainWP Code Snippets is this?
Version 5.1.1, released Jun 16, 2026. New versions appear here when the developer publishes them, and members get them as automatic updates.
How do I update MainWP Code Snippets?
Install the free GPL Feast Updater on your site and connect it with your API key. It installs new versions of MainWP Code Snippets automatically and keeps a backup, so you can roll back.
What does MainWP Code Snippets need?
MainWP Code Snippets needs MainWP installed and active.
More from MainWP







