The main reason to use a snippets plugin instead of your theme’s functions.php is safety: when a snippet goes wrong, you want the plugin to catch it before it takes your site down. Before WPCodeBox, I used the free Code Snippets plugin (I even wrote a guide on adding code snippets safely with it), and in June 2021 I bought a lifetime licence for WPCodeBox. WPCode is the third big name, with 3 million installs.
Every comparison I found lists features. I wanted to know what actually happens when a snippet breaks, so I installed all three on fresh WordPress sites and saved four broken snippets in each one. Here’s what I found.
The short answer
- All three catch the obvious mistakes: a syntax error, or a missing function called directly in the snippet, never gets activated.
- The difference is the error that only happens later, e.g. inside a footer hook or in wp-admin. WPCodeBox switches that snippet off by itself, both on the front end and in wp-admin. WPCode does it in wp-admin only (there’s a one-line fix for the front end, below). Code Snippets (free) leaves it running, and you need its safe mode to get back into wp-admin.
- Speed is not a reason to pick one. With 20 active snippets, none of them made the page noticeably slower.
- For one site and an occasional snippet, a free plugin is enough. For several sites, WPCodeBox is the one I use (more on that in my WPCodeBox review).
How I tested
I used WordPress Playground, which runs a full WordPress in the browser, so I could break things without risking a real site. Each plugin got its own fresh install: WordPress 7.1.4, PHP 8.3, the Twenty Twenty-Five theme and the plugin’s current version on November 9, 2026:
- Code Snippets 4.1.0 (free)
- WPCode Lite 2.4.1 (free)
- WPCodeBox 2, version 1.4.1 (paid, the same version I run on this site)
I created every snippet through the plugin’s own editor and clicked its normal “save and activate” button, so each plugin had the chance to check the code the way it would for you. Then I loaded the site and wp-admin to see what visitors and admins would get.
1. A syntax error
A stray closing brace, the kind of mistake you make when you copy half a snippet from a tutorial:
echo "hello";
if ( true )
echo "missing brace";
}Code language: PHP (php)
All three refused to run it, and the site stayed up.
- Code Snippets saved it but kept it inactive, with a clear message: “Snippet could not be activated. The snippet was saved, but remains inactive due to this error: Unmatched ‘}’.”
- WPCode did the same: “We encountered an error activating your snippet, please check the syntax and try again.”
- WPCodeBox underlined the brace in red while I was typing, which is nice. When I switched the snippet on anyway, the switch said “Enabled” and nothing popped up, but WPCodeBox had quietly turned it back off and stored the error. The snippet’s name only turned red in the list after I refreshed it. It’s safe, but easy to miss.
2. An error on every page load
A call to a function that doesn’t exist, for example because the plugin that provides it is deactivated:
tp_undefined_function();Code language: PHP (php)
Again, all three caught it on save, kept the snippet off and showed an error (WPCodeBox stored it quietly, like before). This is the case most people worry about, and it’s covered by every one of them.
3. An error that only happens later
This is where they differ. The snippet below is valid PHP and runs fine when you save it. It only fails when WordPress reaches the footer of a page, which the save check never does:
add_action( 'wp_footer', function () {
tp_undefined_footer();
} );Code language: PHP (php)
All three activated it. Here’s what the front end returned afterwards:
| First visit | Next visits | Snippet afterwards | |
|---|---|---|---|
| Code Snippets (free) | Error 500, page cut off at the footer | Error 500 | Still active |
| WPCode | Error 500, page cut off at the footer | Error 500 | Still active, error logged |
| WPCodeBox | Error 500, page cut off at the footer | Page works | Switched off automatically |
A page that is cut off at the footer still looks almost normal, so it’s easy to miss (WordPress usually emails the site admin about errors like this, if your site’s emails reach you), while Google gets a 500 error on every page. WPCodeBox is the only one that fixed itself. One visitor got a broken page, then WPCodeBox switched the snippet off and stored the error, and the next visit was fine. I checked its code to make sure this wasn’t just because I was logged in as an admin: the check runs for every visitor.
WPCode records the error on the snippet, and its code shows it can switch snippets off by itself, but by default it only does that for errors that happen inside wp-admin. You can turn it on for the front end too. Add this as a PHP snippet in WPCode and set its Location to Run Everywhere:
add_filter( 'wpcode_auto_disable_frontend', '__return_true' );Code language: PHP (php)
I tested it: with that snippet active, WPCode switched the broken footer snippet off after the first 500 error, and the next visit was fine. This works for snippets set to Run Everywhere (the default for PHP snippets). I didn’t test other locations, and WPCode’s code suggests snippets set to the front end only are still just logged.
Code Snippets left the broken snippet active, so you have to notice the problem and switch it off yourself.
4. An error that locks you out of wp-admin
The scariest one. This snippet breaks every admin screen, including the one you’d use to switch it off:
add_action( 'admin_init', function () {
tp_undefined_admin();
} );Code language: PHP (php)
- Code Snippets: every wp-admin page showed “There has been a critical error on this website.” Your way back in is its safe mode. Add
?snippets-safe-mode=1to the admin URL (for example/wp-admin/admin.php?page=snippets&snippets-safe-mode=1) and the snippets stop running for that request, so you can switch the broken one off. It only works for a logged-in user who can manage snippets, so visitors can’t use it to switch off your snippets. Bookmark it before you need it. The recovery-mode link WordPress emails to the site admin is a second way back in. - WPCode: it switched the snippet off by itself right after I saved it, and wp-admin never broke.
- WPCodeBox: the first admin page showed the critical error, with an extra note (only shown to admins) explaining that WPCodeBox has probably disabled the snippet already. It had: the next admin page loaded normally. If that ever fails, according to its code WPCodeBox has its own safe mode,
/wp-admin/admin.php?page=wpcodebox2&safe_mode=1, ordefine( 'WPCB_SAFE_MODE', true );inwp-config.php.
Do more snippets slow down your site?
I added 20 small PHP snippets to each plugin and counted the database queries on a front-end page, against the same site with no snippets plugin at all (36 queries):
| Plugin active, no snippets | 20 active snippets | |
|---|---|---|
| Code Snippets | 41 queries | 41 queries |
| WPCode | 40 queries | 40 queries |
| WPCodeBox | 42 queries | 62 queries |
Code Snippets loads all active snippets with one query, and WPCode keeps them in a saved option, so the number of snippets makes no difference. WPCodeBox loads them with one query too, but then looks up each snippet again to check its conditions, which is one extra (very small) query per snippet. The page load time didn’t change in a way I could measure. If you run hundreds of snippets it might be worth knowing, but for a normal site it isn’t a reason to choose one over another.
What the free versions give you, and what you pay for
Code Snippets free is the simplest: a list of snippets, an editor, and a choice of where each one runs. Conditions, a preview and cloud sync between sites are in the Pro version. There’s one upsell box under the editor, plus a Go Pro menu item.
WPCode free does a lot more: a library of ready-made snippets, a header and footer box, conversion pixels and a file editor. It can also import your snippets from Code Snippets and a few other plugins in one click, which is useful if you want to switch. On the other hand, 110 of its 142 library snippets only work after you connect a WPCode account, and every WPCode screen had two notices asking me to upgrade or connect.
WPCodeBox has no free version. It’s built for people who write a lot of code: Monaco (the editor VS Code is built on), PHP, JavaScript, CSS and SCSS, conditions, revisions, folders, and cloud snippets you can pull onto another site. It also has MCP access for AI clients, which I covered in the review.
Prices on November 9, 2026:
| Cheapest paid plan | Lifetime licence | Refund | |
|---|---|---|---|
| Code Snippets Pro | From $3.90 a month | From $137 (1 site) to $897 (unlimited) | 14 days |
| WPCode | Basic: $49 for the first year (1 site), then $99 a year | None | 14 days |
| WPCodeBox | $39 a year (1 site), $79 a year (unlimited sites) | $199 (unlimited sites) | 30 days |
The WPCodeBox pricing page says prices will change soon, so the lifetime price may not last. WPCodeBox is also on my list of WordPress lifetime deals.
Which one would I pick?
If you only manage one site and add a snippet now and then, start with a free plugin. I’d pick WPCode for most people, because it gets you out of the admin lockout without any action from you, and the one-line filter above covers front-end errors in Run Everywhere snippets too. If the upsell notices bother you, Code Snippets is the cleaner plugin, as long as you remember the safe-mode URL. Either one is a big step up from editing functions.php.
If you look after more than one site, you’ll want cloud snippets. Code Snippets Pro has cloud sync too, but WPCodeBox is the one I’ve used. Cloud snippets were the reason I bought it in 2021: write a snippet once, pull it onto another site. After this test, I have a second reason: it was the only one that switched off a broken snippet on the front end without me setting anything up.
Closing remarks
- Playground runs PHP in the browser with SQLite instead of MySQL. The query counts are reliable, but the timings are not real-world numbers, so I only compared them with each other.
- I tested as a logged-in admin. For WPCodeBox, I checked in its code that automatically switching off broken snippets doesn’t depend on who is logged in.
- I only tested PHP snippets. A broken JavaScript or CSS snippet can’t take down the server, it just breaks something in the browser.
- In WPCodeBox, the switch kept showing “Enabled” after the plugin had already turned the snippet off. I hope a future version shows the error right away.
Disclosure: the WPCodeBox link is an affiliate link. If you buy through it, I earn a commission at no extra cost to you.
