Set strict file permissions first, then use security plugins as alarms, scanners, and cleanup helpers. In WordPress Multisite, one weak folder can expose many sites at once, especially when plugins, themes, and uploads are shared across the network. WordPress powers about 43% of all websites, which makes it a constant target for automated bots and malware campaigns [source: W3Techs].
TLDR: File permissions are your first wall; security plugins are your cameras and motion sensors. For example, a network with 25 subsites can reduce file tampering risk by locking directories to 755, files to 644, and wp-config.php to 600 or 640. A plugin may detect a changed theme file in 30 seconds, but bad permissions may have allowed the edit in the first place. Use both, but never let a plugin replace server-level file control.
Why Multisite file security is different
A normal WordPress install has one site to protect. A WordPress Multisite network has many sites sharing the same core files, plugins, themes, and often the same hosting account. That shared structure is useful. It is also the reason a single mistake can spread trouble across the whole network.
The most sensitive locations are usually:
- wp-config.php, because it contains database credentials and security keys.
- wp-content/plugins, because plugin files can run PHP code.
- wp-content/themes, because theme templates can also run PHP.
- wp-content/uploads/sites, because every subsite stores media there.
- .htaccess or server rules, because redirects and execution rules live there.
Honestly, it feels like Multisite hides risk behind convenience. One dashboard. One update screen. One bad writable plugin folder. Then you are cleaning ten client sites instead of one.
WordPress file permissions: the first layer
File permissions decide who can read, write, and execute files on the server. They are boring until something breaks. Then they become the difference between a blocked attack and a modified PHP file sitting quietly in your theme folder.
A common baseline is:
- 755 for directories: the owner can write; others can read and enter.
- 644 for files: the owner can write; others can read.
- 600 or 640 for wp-config.php: tighter access for database credentials.
- No 777 permissions: avoid world-writable files and folders.
777 is not a fix. It is a panic button. It may make uploads work, but it also tells other users and processes that they can write there. On shared hosting, that can be ugly.
Ownership matters too. The web server needs enough access to serve files and upload media. It should not have unlimited write power across core files, plugins, and themes. On many setups, the site owner account owns the files, while the web server group has limited access. The exact setup depends on Apache, Nginx, PHP-FPM, cPanel, Plesk, Docker, or managed hosting.
Security plugins: useful, but not magic
Security plugins help with monitoring, scanning, login protection, firewall rules, malware detection, and alerts. They can show you when a plugin file changes. They can block brute force attempts. Some can compare WordPress core files against clean versions.
That is helpful. It is not the same as server security.
A plugin runs inside WordPress. If WordPress cannot safely load, the plugin may not protect anything. If an attacker has already edited a plugin file, disabled the security plugin, or changed database options, your “protection” may be gone before the warning email arrives.
Security plugins are best used for:
- File change alerts across plugins, themes, and core files.
- Malware scanning for known suspicious patterns.
- Login rate limiting for network admin accounts.
- Two-factor authentication for super admins.
- Audit logs showing who installed or edited what.
- Basic firewall rules against common WordPress attacks.
The annoying part is alert noise. Expect to waste time on false positives after plugin updates. A scan may flag changed files that are perfectly normal. Still, it is better than finding injected code three weeks later because a client noticed casino links in Google results.
Permissions vs plugins: which protects files better?
File permissions prevent unauthorized writes. Security plugins detect, warn, and sometimes block actions inside WordPress. These are different jobs.
| Protection method | Best for | Weakness |
|---|---|---|
| File permissions | Stopping unwanted edits to files and folders | Easy to misconfigure, especially on shared hosting |
| Security plugins | Alerts, scans, login defense, activity logs | Can be bypassed if WordPress is already compromised |
| Server rules | Blocking PHP execution in uploads and limiting access | Requires Apache, Nginx, or host-level access |
If you must pick one first, pick permissions. If you want real protection, use both. Then add backups, update discipline, and monitoring.
Secure the uploads folder
The uploads directory is tricky. Users need to upload images, PDFs, and media. Attackers love that. If they can upload a PHP file and run it, the site may be compromised fast.
For Multisite, uploads often live under:
wp-content/uploads/sites/2/
wp-content/uploads/sites/3/
wp-content/uploads/sites/4/
Each subsite gets its own folder. The rule should be simple: media files are allowed; executable scripts are not.
Use server rules to block PHP execution in uploads. On Apache, this can be done with an .htaccess rule. On Nginx, use a location block. Many managed hosts already do this, but do not assume. Check it.
Also restrict file types in WordPress. Do not allow SVG, PHP, HTML, or script-like uploads unless you really know why they are needed. SVG files can contain scripts. That surprise has ruined plenty of afternoons.
Lock down plugins and themes
In Multisite, plugins and themes are shared assets. A vulnerable plugin can affect the entire network. A compromised theme can inject code into every subsite that uses it.
Use these controls:
- Disable the plugin and theme editor by adding
define('DISALLOW_FILE_EDIT', true);to wp-config.php. - Limit plugin installation to trusted super admins only.
- Remove unused themes and plugins, not just deactivate them.
- Update from trusted sources and avoid abandoned plugins.
- Use staging to test updates before applying them network-wide.
For extra control, set plugin and theme files to read-only for the web server after updates. This reduces the chance of silent file edits. It may make updates less convenient, but convenience is not the goal during a cleanup.
Protect wp-config.php
wp-config.php deserves special treatment. It holds database credentials, salts, table prefix details, and Multisite settings. If someone reads it, your database may be exposed.
Set tight permissions, such as 600 or 640, depending on your server. Move sensitive constants outside the web root if your hosting setup supports it. Block browser access through server rules. Also keep backups of this file somewhere safe, but not inside a public folder.
A practical Multisite file security checklist
- Set directories to 755 and files to 644.
- Set wp-config.php to 600 or 640.
- Never use 777 on live folders.
- Block PHP execution inside uploads.
- Disable built-in file editing from the dashboard.
- Install a trusted security plugin for scans and alerts.
- Enable two-factor authentication for every super admin.
- Keep plugins and themes lean, updated, and reviewed.
- Use offsite backups with restore testing.
- Review file ownership after migrations and host changes.
Best setup for most Multisite networks
The strongest option is layered security. Let permissions stop writes. Let server rules block risky execution. Let a security plugin watch for changes. Let backups save you when something still slips through.
For a small network, basic permissions plus a good security plugin may be enough. For agencies, schools, publishers, and SaaS-style networks, add stricter ownership rules, deployment workflows, activity logs, and host-level malware scanning.
WordPress Multisite is powerful, but it is not forgiving. Treat shared files like shared keys. If one person drops them, every site on the network may feel it.