Skip to main content

644

644 Permission Code**

Permission Code: 644 Standard File Permissions for WordPress

644 gives **read/write access to the owner, and **read-only access to group and others.

rw-r--r--

This is the **default and recommended file permission mode for WordPress files on a VPS.

It ensures files are editable by the site owner but not by the public or other system users.

Technical Structure

NoRoleBitsAccessAllowed?
1Ownerrw-read/write
2Groupr--read only
3Othersr--read only

Behavior

  • Owner can edit and modify files
  • Group and everyone else can read, but not modify
  • Safe for theme files, plugin files, core files, PHP files

This mode prevents unauthorized changes while ensuring WordPress and the web server can read files to render pages.

WordPress Use Cases

NoLocationSuitabilityReason
1Theme fileseditable by owner, readable by server
2Plugin filesprevents malicious modification
3WordPress core filesrecommended by WP security
4PHP files in public WP pathsafe required baseline
5wp-config.phpneeds stricter permission (600)

Why 644 Works for WordPress

  • Web server only needs to **read files, not write
  • Prevents write access from unauthorized users
  • Avoids accidental permission escalations
  • Meets hosting and security best practices

This is the **security default across professional WP infrastructures.

Commands for WordPress VPS

Apply 644 to ALL files

find . -type f -exec chmod 644 {} ;

Secure config file separately

chmod 600 wp-config.php

find . -type d -exec chmod 755 {} ;

When to Use 644

NoScenarioUse 644Reason
1Single-site VPSbest security-to-function balance
2Managed hostingdefault WP convention
3Standard WP file installworks out-of-the-box
4CI/CD pipelinesunless auto-write needed
5Shared server with unknown usersrestrict write access

When NOT to Use 644

NoScenarioAvoidReason
1wp-config.phpshould be 600
2Uploads folder files (temporary write phase)WordPress needs to write but still ok for final state
3Private scripts or SSH filesmay require 600 or 700

Example Correct Application on WordPress

cd /var/www/your-site/
find . -type d -exec chmod 755 {} ;
find . -type f -exec chmod 644 {} ;
chmod 600 wp-config.php

Also ensure ownership is correct:

chown -R wpuser:www-data .

Real Troubleshooting Notes

NoIssueCauseRemedy
1WP can't write config/pluginsnormal with 644use wp-cli or SFTP to edit
2Plugin editor can't savesecurity by defaultedit via SFTP or raise perms temporarily
3Uploads faildirectory perms issue, not file permsfix with 755 directories

Exercise

  1. Apply 644 to all files in a test WP directory
  2. Try editing via SFTP (allowed)
  3. Try editing via public user (denied)
  4. Confirm integrity via:
stat wp-settings.php

Expected:

Access: (0644/-rw-r--r--)

Key Takeaways

NoRuleStatus
1644 is standard WP file permission
2Owner writes, others read only
3Public cannot modify files
4Works with Nginx / OLS / Apache
5Must secure wp-config.php separately (600)

Summary:

For all WordPress files: 644
For directories: 755
For wp-config.php: 600