Hardening WordPress files

If you have shell access to your server, you can change file permissions recursively with the following commands.

For directories:

find /path/to/your/wordpress/install/ -type d -exec chmod 755 {} \;Code language: Bash (bash)

For files:

find /path/to/your/wordpress/install/ -type f -exec chmod 644 {} \;Code language: Bash (bash)

To do them both in current folder recursively:

find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \;Code language: Bash (bash)

User correction:

chown -R www-data:www-data .Code language: Bash (bash)

Posted

in

, ,

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.