Why I ask this question
When I see video titles such as “Use code snippets instead of plugins to reduce your plugin count,” I am skeptical. There may be a useful idea behind the advice, but it is misleading as a general rule. Poor code can slow down a website or introduce security vulnerabilities, regardless of where it comes from.
When I wrote the original article in 2025, I had already been using small functionality plugins for more than 15 years. I have also used Code Snippets on many websites since 2012, and I enjoy working with it. This is not an argument against snippets. It is an explanation of why I value both approaches and choose according to the project.
What applies to both approaches
- Code has to live somewhere and be loaded: in a plugin directory, a theme or child theme, a database, or a file generated by a snippet manager. Its location alone tells you little about its quality.
- Code needs maintenance. Security issues and changes to WordPress or PHP may require updates.
- Unsafe or faulty code can cause problems anywhere. Troubleshooting can be difficult in a snippet, a plugin or a functions.php file alike.
- An advantage can also be a drawback: fixed conditions may protect one client project from accidental changes while limiting flexibility in another.
Plugins: strengths and potential drawbacks
What works well
- Updates can be delivered through a suitable update channel and, where supported and enabled, installed automatically.
- Translation files and WordPress language packs fit naturally into a plugin’s structure, supporting translatable interfaces and multilingual projects.
- On Multisite, network activation can make shared management easier.
- Suitable code can also be organized as a must-use plugin, which loads automatically and stays active.
- Plugins can be managed from the command line using WP-CLI.
- Execution conditions defined by the developer are not easily changed by clients, which can be desirable.
- Multiple PHP files can be organized together.
- Scripts, stylesheets and other files can be included as one coherent package.
- WordPress provides basic error checks during plugin activation. These do not replace a complete review.
- The WordPress.org directory has submission and review requirements. These provide a framework, not a guarantee of flawless or secure code.
- Plugin source code normally lives in files rather than in the database. Depending on the attack scenario, that separation can be useful.
- An identifiable author and a maintained project often provide a route for questions, feedback or support.
What to weigh up
- Some plugins grow beyond their original purpose and accumulate unnecessary settings.
- Advertising and intrusive upsells can clutter the WordPress admin.
- Some plugins load assets where they are not needed, creating unnecessary overhead.
- For some users, activating and deactivating a plugin feels less convenient than toggling a snippet.
- Plugin count is easily mistaken for a performance problem. Many small, well-written plugins can work well together; each implementation needs to be assessed on its own.
- Hard-coded conditions may require additional code to change, or may offer no practical way to change them.
Code snippets: strengths and potential drawbacks
What works well
- Many users find activation, deactivation and condition management especially convenient.
- Depending on the snippet manager, conditions can be configured through a visual interface.
- Titles, descriptions, tags and other metadata help organize customizations.
- Snippets are convenient for small, clearly defined tasks, such as a few lines or a few dozen lines of code.
- A snippet manager can help site builders who do not have access to theme files or SFTP on a client website.
- Snippets stored in the database can travel with a database backup.
- A safe mode can help recovery after a problematic snippet, where the manager provides one.
- In my experience, a snippet manager’s activation checks can be more helpful than WordPress’s basic checks. They still cannot detect every logic error.
What to weigh up
- A copied snippet usually has no automatic update channel of its own, leaving you responsible for maintaining it.
- Translations and WordPress language packs are less straightforward for a pasted snippet than for a plugin structured to support them.
- Multisite support depends on the manager. I particularly value the network-wide snippets in Code Snippets, which I have been able to use in its free edition.
- The manager must load before it executes its snippets. For hooks that need to run early, a plugin or must-use plugin may be a better fit.
- Poor naming and missing prefixes can cause conflicts with other code.
- Shared snippets sometimes omit permission checks, input validation or safe output handling, which can create security vulnerabilities.
- An easy-to-use interface for pasting code does not make the snippet a no-code solution.
- Anyone who copies and activates code takes responsibility for its effects, even if they do not fully understand it.
- Without a clear source or an accessible author, there is often no useful route for support or feedback.
A quick guide for everyday decisions
These examples are starting points, not fixed rules. This guide is an addition to the original 2025 article. The implementation and responsibility for future maintenance still determine the right choice.
Often a good fit for a snippet
- A small customization for one website: you want to use an existing filter to change a label, for example. A focused snippet can be a good fit.
- A focused extension to an existing plugin: you use a documented hook and understand its requirements. A snippet keeps the customization separate from the plugin’s own code.
- A few project-specific customizations that you maintain yourself: you already use a snippet manager and want to name, organize and selectively enable or disable each change there.
Often a good fit for a plugin
- A coherent feature with multiple files: PHP, stylesheets, scripts and perhaps translations need to be maintained as one package. A plugin is often easier to organize for this purpose.
- The same tool on several client websites: you want a clear version and an established update process. A maintained plugin with a suitable update channel is often a better foundation.
- A feature that must load early: the required hook runs before the snippet manager loads the code. An appropriately loaded plugin or must-use plugin may then be necessary; the actual loading order determines the choice.
My answer: choose for the task
I would not reject a plugin simply because it adds another entry to the plugin list, or favor a snippet simply because it is short. A small customization in a well-managed snippet manager can be exactly right. A plugin may be a better fit for related features, multiple files and an established update process.
What matters is an informed choice for the project: what functionality do I need, who maintains the code, and what options do I have if something goes wrong? Plugins and snippets are tools, not competing belief systems.