{
    "title": "WordPress file permissions: 644, 755 and the wp-config.php case",
    "seo_title": "WordPress file permissions: 644 and 755 explained",
    "h1": "WordPress file permissions: 644, 755 and the wp-config.php case",
    "description": "WordPress file permissions: what 644 and 755 mean, why wp-config.php should be 400 or 440, and the values (like 777) you should never use.",
    "lead": "644, 755, wp-config.php at 400: WordPress permission rules fit in a handful of numbers. Here they are, and what you should never do.",
    "language": "en",
    "locale": "en-US",
    "type": "article",
    "url": "https://www.wp-feint.com/wordpress-file-permissions/",
    "canonical": "https://www.wp-feint.com/wordpress-file-permissions/",
    "markdown": "https://www.wp-feint.com/wordpress-file-permissions/index.md",
    "json": "https://www.wp-feint.com/wordpress-file-permissions/index.json",
    "published": "2026-10-15T07:00:00+00:00",
    "modified": "2026-11-22T14:34:01+00:00",
    "site": {
        "name": "WP Feint",
        "url": "https://www.wp-feint.com/"
    },
    "translations": [
        {
            "language": "en",
            "hreflang": "en-US",
            "title": "WordPress file permissions: 644, 755 and the wp-config.php case",
            "url": "https://www.wp-feint.com/wordpress-file-permissions/",
            "markdown": "https://www.wp-feint.com/wordpress-file-permissions/index.md",
            "json": "https://www.wp-feint.com/wordpress-file-permissions/index.json"
        },
        {
            "language": "fr",
            "hreflang": "fr-FR",
            "title": "Permissions de fichiers WordPress : 644, 755 et le cas wp-config.php",
            "url": "https://www.wp-feint.com/fr/permissions-fichiers-wordpress/",
            "markdown": "https://www.wp-feint.com/fr/permissions-fichiers-wordpress/index.md",
            "json": "https://www.wp-feint.com/fr/permissions-fichiers-wordpress/index.json"
        },
        {
            "language": "es",
            "hreflang": "es-ES",
            "title": "Permisos de archivos en WordPress: 644, 755 y el caso de wp-config.php",
            "url": "https://www.wp-feint.com/es/permisos-archivos-wordpress/",
            "markdown": "https://www.wp-feint.com/es/permisos-archivos-wordpress/index.md",
            "json": "https://www.wp-feint.com/es/permisos-archivos-wordpress/index.json"
        },
        {
            "language": "de",
            "hreflang": "de-DE",
            "title": "WordPress-Dateiberechtigungen: 644, 755 und der Fall wp-config.php",
            "url": "https://www.wp-feint.com/de/wordpress-dateiberechtigungen/",
            "markdown": "https://www.wp-feint.com/de/wordpress-dateiberechtigungen/index.md",
            "json": "https://www.wp-feint.com/de/wordpress-dateiberechtigungen/index.json"
        },
        {
            "language": "it",
            "hreflang": "it-IT",
            "title": "Permessi dei file WordPress: 644, 755 e il caso wp-config.php",
            "url": "https://www.wp-feint.com/it/permessi-file-wordpress/",
            "markdown": "https://www.wp-feint.com/it/permessi-file-wordpress/index.md",
            "json": "https://www.wp-feint.com/it/permessi-file-wordpress/index.json"
        },
        {
            "language": "pt",
            "hreflang": "pt-BR",
            "title": "Permissões de arquivos no WordPress: 644, 755 e o caso do wp-config.php",
            "url": "https://www.wp-feint.com/pt/permissoes-arquivos-wordpress/",
            "markdown": "https://www.wp-feint.com/pt/permissoes-arquivos-wordpress/index.md",
            "json": "https://www.wp-feint.com/pt/permissoes-arquivos-wordpress/index.json"
        },
        {
            "language": "nl",
            "hreflang": "nl-NL",
            "title": "Bestandsrechten in WordPress: 644, 755 en het geval wp-config.php",
            "url": "https://www.wp-feint.com/nl/bestandsrechten-wordpress/",
            "markdown": "https://www.wp-feint.com/nl/bestandsrechten-wordpress/index.md",
            "json": "https://www.wp-feint.com/nl/bestandsrechten-wordpress/index.json"
        }
    ],
    "headings": [
        {
            "level": 1,
            "text": "WordPress file permissions: 644, 755 and the wp-config.php case"
        },
        {
            "level": 2,
            "text": "Reading a permission in thirty seconds"
        },
        {
            "level": 2,
            "text": "Recommended values for WordPress"
        },
        {
            "level": 2,
            "text": "The special case of wp-config.php"
        },
        {
            "level": 2,
            "text": "What is genuinely dangerous"
        },
        {
            "level": 2,
            "text": "Owner and group: the other half of the topic"
        },
        {
            "level": 2,
            "text": "Restoring order in two commands"
        },
        {
            "level": 2,
            "text": "Where WP Feint fits in"
        },
        {
            "level": 2,
            "text": "Checking the current state of your files"
        },
        {
            "level": 2,
            "text": "When a permission breaks a feature"
        },
        {
            "level": 3,
            "text": "Key takeaways"
        },
        {
            "level": 2,
            "text": "Sources"
        }
    ],
    "body": "File permissions are one of those topics people put off until the day an upload error or a misunderstood tip turns a site into a sieve. Yet the rules fit in a handful of numbers. This article explains what 644 and 755 mean, why `wp-config.php` deserves special treatment, and which values are genuinely dangerous on WordPress hosting.\n\n## Reading a permission in thirty seconds\n\nOn Linux, every file carries three sets of rights: the owner, the group, and others (everyone else). For each set, three actions are possible: read (r), write (w), execute (x). The numbers you see (644, 755) are simply these rights translated into octal notation, where read is worth 4, write 2 and execute 1.\n\n- **644** corresponds to `rw-r--r--`: the owner reads and writes, the group and others can only read. This is the normal value for files.\n- **755** corresponds to `rwxr-xr-x`: the owner has all rights, the group and others can read and traverse. The execute bit on a directory lets you enter it, not run a program. This is the normal value for directories.\n\n![Breakdown of permissions 644 into rw- r-- r-- and 755 into rwx r-x r-x, with a reminder that wp-config.php should be 400 or 440 and that 777 must never be used.](https://www.wp-feint.com/media/permissions-en.webp)\n\n## Recommended values for WordPress\n\nThe official WordPress documentation gives a simple scheme: all directories at 755 and all files at 644. These values let the web server read and serve the site, while reserving write access for the owner of the files. They are enough for the vast majority of installations.\n\n| Target | Recommended value | Why |\n| --- | --- | --- |\n| Directories | 755 | The server can traverse them, only the owner writes |\n| Files | 644 | Public read access, write access reserved for the owner |\n| wp-config.php | 400 or 440 | Contains the database credentials and secret keys |\n| .htaccess | 644 (sometimes 444) | Read by the server; 444 if no plugin needs to write to it |\n| wp-content/uploads | 755, no PHP execution | An uploaded file must never be able to execute |\n\n*Recommended permission scheme, to adapt to your host's configuration.*\n\n## The special case of wp-config.php\n\nThis file holds the site's secrets: database login credentials, authentication keys and salts. The WordPress documentation recommends making sure that only you and the web server can read it, which generally translates into a 400 or 440 permission. The idea is to remove all rights from other users on the server, a sensitive point on [shared hosting](https://www.wp-feint.com/glossary/shared-hosting/) where several sites share the same machine.\n\nBe careful, though: some hosts require 640, 600 or even 644 for their PHP configuration to work. A good method is to aim for the strictest value, then loosen it by one notch only if the site returns an error. Always test that the site displays correctly after a change.\n\n## What is genuinely dangerous\n\nThe real trap is not choosing 755 over 750. It is applying, often on the strength of a hastily found tip, permissions that are far too open just to make a \"permission denied\" error go away.\n\n- **777 on a directory or file.** This allows any user on the server to write, and therefore to replace a PHP file with [malicious code](https://www.wp-feint.com/glossary/malware/). If an attacker gains an entry point through a vulnerable plugin, a 777 directory gives them a place to drop and run their payload. Never use 777.\n- **PHP execution in the uploads directory.** A form that accepts poorly filtered files, combined with an `uploads` directory able to execute PHP, is a classic recipe for a takeover. This directory should serve media, not run scripts.\n- **A world-readable wp-config.php.** On a poorly isolated shared server, a publicly readable configuration file exposes your database credentials.\n\n## Owner and group: the other half of the topic\n\nPermissions do not tell the whole story. You also need to know who owns the files. Two setups exist on modern hosting.\n\n- **The web server runs under your user account** (common with per-pool [PHP-FPM](https://www.wp-feint.com/glossary/php-fpm/), or with suPHP). The files belong to you, and 644 or 755 are enough for WordPress to write when it updates a plugin.\n- **The web server runs under a separate account** (for example `www-data`). That account then needs to belong to your group, and you sometimes have to allow group write access, without ever opening it to \"others\".\n\nIn practice, your host has already chosen a model. Before changing anything, take a full backup and find out how it is configured. Permissions that are too strict break automatic updates; permissions that are too loose make an attacker's life easier.\n\n## Restoring order in two commands\n\nIf your permissions are inconsistent, the WordPress documentation suggests resetting them with two commands, to run from the site root over SSH:\n\n```\nfind /path/to/site/ -type d -exec chmod 755 {} \\;\nfind /path/to/site/ -type f -exec chmod 644 {} \\;\n```\n\nThen apply the strict value to `wp-config.php` with `chmod 400 wp-config.php`, and check that the site and the admin area respond normally. If you do not have SSH access, most file managers and FTP clients let you set these same values on a directory and its contents.\n\n## Where WP Feint fits in\n\nLet us be clear: WP Feint modifies neither core files nor the server configuration, and therefore does not change your permissions for you. Setting permissions remains a task to carry out at the hosting level. The plugin works on a different, complementary level.\n\nOn the one hand, it makes its own files (readme, translations, PHP files) invisible to scanners on Apache, LiteSpeed and o2switch, which reduces the clues a bot can collect. On the other hand, its [WordPress core integrity check](https://www.wp-feint.com/features/wordpress-integrity-check/) compares your files with the official versions and flags any unexpected change, the typical symptom of a file rewritten thanks to overly open permissions. Finally, managing [file URLs](https://www.wp-feint.com/features/file-url-aliases/) makes the standard paths harder to spot. These measures do not replace correct permissions: they add to a sound foundation.\n\n## Checking the current state of your files\n\nBefore fixing anything, you need to know where you are starting from. Over SSH, the `ls -l` command shows permissions as letters, and `stat` gives the exact octal value of a file. Many hosting file managers and FTP clients also display these rights, often in a \"Permissions\" column or by right-clicking the file.\n\nFocus on a few sensitive spots: `wp-config.php`, the `wp-content/uploads` directory, the `.htaccess` file at the root, and any directory showing 777. Spotting a single anomaly in these places is worth more than reviewing thousands of files that behave normally.\n\n## When a permission breaks a feature\n\nPermissions that are too strict also have visible effects, and it helps to be able to trace them back to their cause. A plugin update that fails, a media file that cannot be uploaded, a cache file that does not get created: these symptoms often point to a permissions or ownership problem rather than a WordPress bug.\n\nThe temptation is then to open permissions wide so that \"it works\". That is the mistake to avoid. The right approach is to understand which account needs to write where. On shared hosting, the host usually has the answer, and its support team can tell you whether the web server runs under your account or under a separate one. A question to support costs less than a site exposed by a 777 left in place \"just while testing\", then forgotten.\n\n### Key takeaways\n\n- Basic rule: directories at 755, files at 644.\n- wp-config.php: aim for 400 or 440, loosen only if your host requires it.\n- Never use 777, and prevent PHP execution in the uploads directory.\n- Back up before making changes, then test the site and the admin area.\n\n## Sources\n\n- [WordPress Developer, Hardening WordPress (file permissions)](https://developer.wordpress.org/advanced-administration/security/hardening/)\n- [WordPress Developer, Changing File Permissions](https://developer.wordpress.org/advanced-administration/server/file-permissions/)",
    "categories": [
        "Hosting and server"
    ],
    "format": "application/json"
}