November 7, 2026

WordPress File Permissions Security Best Practices

Blog WordPress Security

Why File Permissions Matter for WordPress Security

Running a WordPress site means managing more than content and design. File permissions control who can read, write, and execute files on your server. When these settings are too loose, attackers can upload malicious scripts or alter configuration files. When they are too tight, your site breaks during updates, image uploads, or plugin installations. Small business owners often overlook this layer until a security incident forces their attention.

Every file and folder on a Linux server carries an owner, a group, and a public permission set. WordPress needs write access to certain areas, such as the uploads folder, so visitors can submit images and the system can store media. Core files should generally be read only for the public. If a folder is writable by everyone, any account on the same server could potentially drop a malicious file into your directory. On shared hosting, this risk is especially real because many websites share the same server environment.

Permissions are not a complete security strategy, but they are a foundation. A strong login process and regular updates cannot compensate for a world readable wp-config file that exposes database credentials. Thinking about file access early prevents costly cleanups later.

Common File Permission Mistakes Small Businesses Make

Most permission problems start with a quick fix that becomes permanent. Understanding the most frequent errors helps you avoid them before they create an opening.

Setting Every Folder to 777

A common scene plays out when an image upload fails. A site owner searches for a fix and finds advice to set folder permissions to 777. This setting gives read, write, and execute rights to the owner, the group, and everyone else. The upload error may disappear, but the folder is now open to any user on the server. A hypothetical boutique store might follow this advice during a busy product launch, only to discover weeks later that an unrelated account placed a spam script in the uploads directory. The shortcut solves one symptom and creates a serious exposure.

Leaving wp-config.php Readable to Everyone

The wp-config.php file holds database names, usernames, passwords, and security keys. If its permissions allow the public to read it, anyone who guesses the file path can download it through a browser. Many default installations leave this file at 644, which means the owner can read and write while the group and public can only read. On some shared hosts, that read access is enough for other accounts to view the contents. Tightening this file to 600 or 640, depending on how your host runs PHP, removes public read access while preserving site functionality.

Granting Write Access to Core Folders

The wp-admin and wp-includes folders contain the core code that runs WordPress. These areas do not need write access for normal operation. When a developer sets them to 775 or 777 to bypass an update error, they open the door to code injection. If an attacker gains access through a vulnerable plugin, writable core folders make it much easier to insert malicious files that persist across updates. Core folders should stay read only for the public and writable only by the trusted system user.

Forgetting to Reset Temporary Changes

Developers sometimes loosen permissions to troubleshoot a white screen or a failed migration. They may set a folder to 777, confirm the problem is solved, and then forget to return it to 755. The site keeps working, so the temporary change stays in place indefinitely. Over time, these forgotten exceptions accumulate and weaken the overall security posture. A note in a project file or a calendar reminder can prevent this drift.

Understanding WordPress Permission Numbers

Permission numbers use three digits. Each digit represents the owner, the group, and the public. The values are read equals four, write equals two, and execute equals one. Adding these values gives the digit for each category.

For example, 755 means the owner can read, write, and execute, while the group and public can read and execute but not write. The number 644 means the owner can read and write, while the group and public can only read. The number 600 means only the owner can read and write, with no access for the group or public.

These numbers are not arbitrary. Choosing the wrong one can either expose sensitive data or block WordPress from writing cache files, uploaded images, or update packages.

Recommended Permissions for Folders and Files

Most WordPress installations work well with the following baseline. Treat these as starting points and adjust only if your hosting environment requires it.

Folders should usually be 755 or 750. This allows the owner to manage the directory while limiting write access for others.

Files should usually be 644 or 640. This allows the owner to edit the file while preventing others from modifying it.

The wp-config.php file should be 600 or 640. This removes public read access and protects database credentials.

The .htaccess file should be 644 so the server can read it while blocking public writes.

Files inside the uploads folder should not be executable. Even if the folder is 755, you should prevent PHP files from running inside that directory through additional server rules. This stops an attacker from executing a script even if they manage to upload one.

These recommendations assume a standard setup. Some managed WordPress hosts handle permissions differently, so check your host documentation before applying changes broadly.

How to Check and Change Permissions Safely

You can view and modify permissions through an FTP client or your hosting control panel file manager. In most FTP applications, right-clicking a file or folder reveals a permissions dialog where you can enter a numeric value or toggle checkboxes for read, write, and execute.

Before making changes, create a backup of your site and database. Changing permissions on the wrong folder can make the site inaccessible or break the admin panel. Change one directory at a time, refresh the website, and confirm that uploads, updates, and page loads still work.

If you are on shared hosting, you may not own the server user account that runs PHP. In that case, some permission changes may have no effect or may be overridden by the host. Contact your hosting support and ask which user runs the WordPress process. They can often apply the correct ownership and permissions for you.

After any change, visit the media library, try uploading an image, and test a plugin update. If anything fails, revert the permission and investigate further rather than leaving an open setting in place.

Additional Lockdown Steps Beyond Permissions

Permissions are only one layer. You should combine them with other WordPress security habits.

Disable File Editing From the Dashboard

WordPress allows administrators to edit theme and plugin files directly from the admin area. If an attacker compromises an admin account, this feature provides a direct path to insert malicious code. Turning it off removes that convenience but adds meaningful protection. You can apply this setting through your site configuration file so that the built-in editor is no longer available.

Restrict Access to Sensitive Folders

You can use server configuration rules to block direct browser access to wp-includes and parts of wp-admin. These rules do not stop WordPress from functioning, but they prevent outsiders from browsing directory contents or calling files directly. Ask your developer to implement these rules if your hosting environment allows them.

Keep Software Updated

Outdated plugins and themes are a more common entry point than permission issues. Run updates on a staging copy first, then apply them to the live site once you confirm compatibility. Updated software closes known vulnerabilities that permissions alone cannot block.

Building a Regular Permission Review Routine

Security settings drift over time. Schedule a review every quarter or after any major site change. During the review, check the permissions on wp-config.php, the uploads folder, and core directories. Ask your developer or host to confirm that no temporary 777 settings remain. Document who has server access and remove accounts for people who no longer work on the site.

When you migrate to a new host, permissions do not always transfer correctly. Treat migration as a reset point and reapply your baseline settings after the move. A fresh server may restore files with overly permissive defaults, so verify access levels before pointing your domain to the new environment.

Conclusion

File permissions decide whether your WordPress site is a closed office or an open storefront. Loose settings invite unauthorized changes, while overly strict settings stop your business from operating normally. Start with the baseline recommendations above, fix any 777 folders you find, and protect wp-config.php above all else. Pair these settings with regular updates, strong login controls, and reliable backups. If you are unsure about your current setup, ask your hosting provider or a WordPress developer to review your file access before a problem finds you.