
WP Permissions Fixer
Generate the correct chmod and chown commands to fix WordPress file and folder permissions.

#!/bin/bash
# WordPress Permissions Fix Script
# Server: apache
# Path: /var/www/html
# Set ownership
chown -R www-data:www-data /var/www/html
# Set directory permissions (755)
find /var/www/html -type d -exec chmod 755 {} \;
# Set file permissions (644)
find /var/www/html -type f -exec chmod 644 {} \;
# Secure wp-config.php (600)
chmod 600 /var/www/html/wp-config.php
# Secure .htaccess (640)
chmod 640 /var/www/html/.htaccess
# Make wp-content writable for uploads
chmod -R 775 /var/www/html/wp-content/uploads
# Make plugins/themes updatable
chmod -R 775 /var/www/html/wp-content/plugins
chmod -R 775 /var/www/html/wp-content/themesWhy permissions matter
Incorrect file permissions are one of the most common causes of WordPress issues — white screens, failed plugin installs, media upload errors, and update failures. WordPress needs to read its own files and write to specific directories like wp-content/uploads and wp-content/cache. If permissions are too restrictive, WordPress cannot function. If they are too loose, any process on the server can modify your files, which is a serious security risk on shared hosting.
The correct permissions
The standard recommendation for WordPress is 755 for directories and 644 for files. This means the owner (your web server user) can read and write, while the group and others can only read. The wp-config.php file should be set to 600 or 640 since it contains your database credentials and should not be readable by other users on the server. The wp-content/uploads directory needs to be writable by the web server process, which is typically handled by ensuring the correct ownership rather than opening permissions to 777.
Ownership vs permissions
People often confuse chmod (permissions) with chown (ownership). Permissions control what actions are allowed — read, write, execute. Ownership determines who those permissions apply to. If your files are owned by root but your web server runs as www-data, even 755 permissions will not let WordPress write to its own directories. The generated commands set both ownership and permissions correctly for your server configuration.
Related Tools
WP Admin Generator
Generate SQL queries to create WordPress admin accounts instantly. Useful when locked out or need quick database-level access.
WP Search & Replace
Generate SQL queries for safe search-replace operations. Perfect for WordPress domain migrations.
htpasswd Generator
Generate Apache .htpasswd entries for basic authentication with MD5, SHA-1, or plain text hashing.