~$perlat kociaj
// free-tools

WordPress Permissions Fixer

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

Shell Script
#!/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/themes
Standard WordPress Permissions
755 directories
644 files
600 wp-config.php
640 .htaccess

Related Tools