Set WordPress file and folder permissions via terminal

If you read the recommended guide for Changing File Permissions on WordPress.org it will leave you wondering what's the terminal command to actually apply the changes.

Go to the folder where your WordPress install is and run these commands:

Let Apache be owner

chown www-data:www-data -R *
Code language: CSS (css)

Change directory permissions rwxr-xr-x

find . -type d -exec chmod 755 {} \;
Code language: CSS (css)

Change file permissions rw-r--r--

find . -type f -exec chmod 644 {} \;
Code language: CSS (css)

Props: https://stackoverflow.com/questions/18352682/correct-file-permissions-for-wordpress

About Ricard Torres

Senior Front-end Software Engineer at Netcentric, from Barcelona, Haidong Gumdo Instructor (korean martial art of the sword), street photographer, travel lover, TV addict, Boston Red Sox fan, and privacy advocate.

@ricard_dev @ricard_dev

📝 Blog 🎙 Podcast

Leave a Reply

Add <code> Some Code </code> if you need to.

*
*