Practical security advice for website owners
WordPress Code Snippets and MU-Plugins: Review Hidden Custom Functionality

Security guidance · References checked 2 November 2026
In this guide
Your WordPress plugin list does not describe every piece of custom code running on the site. A child theme, MU-plugin, snippet manager, hosting integration or deployment script may add important behaviour. Some of it may be legitimate and essential; unexplained changes need review.
A useful investigation does not start by deleting anything that looks technical. It starts by finding the execution locations, identifying who owns them and comparing the behaviour with the business’s approved requirements.
Build a custom-code inventory
List the active theme and child theme, ordinary plugins, MU-plugins, snippet managers and custom files documented by the host or developer. Include integrations stored in settings when the product supports that approach. Record source, purpose, maintainer and deployment route.
WordPress’s MU-plugin documentation explains that these components load automatically and appear separately from ordinary plugins. Hosts commonly use them for legitimate platform functions. Their location is a reason to include them in the review, not evidence that they are malicious.
Ask the previous maintainer for a handover record. If none exists, mark the source as unknown rather than inventing a purpose based on a filename. A short descriptive label can be imitated and may not match the code’s behaviour.
Identify who can create executable changes
Review accounts that can install plugins, change theme files, manage snippets or deploy code through hosting and source control. A safe code review can be undermined if an unauthorised user still has permission to change the result immediately afterwards.
Use the actual capability model and plugin permissions, not only the displayed role name. The WordPress roles and capabilities reference explains that roles consist of permissions that components can extend.
Coordinate access changes with the business owner. Do not remove the only recovery administrator or disable a deployment account without arranging the required replacement. The aim is accountable, limited access while keeping an authorised path to maintain the site.
Preserve context before editing
Save the relevant file or setting, timestamp, source path and available change history privately. Include a protected recovery point appropriate to the affected components. Do not paste unreviewed code or secrets into public issue trackers.
For database-stored snippets, understand the plugin’s storage and export mechanism before changing records directly. The interface may also store conditions, priorities or activation state that affect execution. A text search alone can miss that context.
Keep facts separate from hypotheses. “This snippet sends data to an unapproved endpoint” is a finding if verified. “This was installed by a particular attacker” needs separate evidence. Accurate language matters for both the investigation and the client relationship.
Review behaviour and dependencies
A qualified developer should identify when the code runs, what input it accepts, what data it changes and which external services it contacts. Compare it with a trusted source or approved implementation where one exists. Minified, encoded or generated code needs context rather than an automatic verdict.
Inspect permission checks, validation and secret handling for the relevant action. A legitimate snippet can still be unsafe or defective. Conversely, a strange-looking hosting loader may be a supported component that should not be removed without the provider’s guidance.
Identify the business functions at risk before disabling code. A small snippet can control a checkout rule, a notification or an access restriction. Removing it may create a new problem even when further security work is warranted.
Test changes in a controlled environment
Use a suitably isolated copy with harmless test data where possible. Prevent live charges, customer messages and other external side effects. Do not assume that calling it “staging” automatically disables those actions.
Make the smallest reviewed change and run the corresponding functional tests. Confirm both the intended behaviour and the security boundary. For example, a private administrative action should work for the authorised test role and fail without producing a side effect for an unauthorised role.
Retain a documented rollback route. A code-management plugin’s recovery mode can be helpful if supported, but it does not replace a deployment plan. Know how an authorised maintainer will regain access if a snippet causes a fatal error.
When an incident is suspected
Do not rely solely on disabling a snippet in the visible dashboard. Investigate the source of the change and other access paths according to the evidence. Unauthorised code may coexist with modified files, settings or scheduled tasks.
An incident responder should preserve relevant records where practical, contain ongoing harm and verify that the identified behaviour has stopped. The exact sequence depends on the site’s state. A snippet review is one part of recovery, not a guarantee that every component has been examined.
Avoid treating a particular legitimate snippet-management product as inherently malicious because somebody could misuse its features. The finding should describe the unauthorised change and access, not make an unsupported claim about all installations of the product.
Leave a maintainable handover
Every retained custom component should have a purpose, owner, source and test record. Remove unused code through an approved change process. Keep secrets in an appropriate protected configuration rather than in broadly visible snippets or exported settings.
For a review request, send the public website URL, observed behaviour and the locations you know contain custom code. Do not send credentials or a complete private export initially. A scoped assessment can then distinguish legitimate functionality, ordinary bugs and changes requiring a wider security investigation.
Published by NithuDev. About Nithu / Suthakaran Nithursan, website developer and security recovery specialist. Featured artwork is an AI-generated editorial illustration, not a photograph of a client, a real security incident or a verified tool result.