Last active
August 29, 2015 13:55
-
-
Save christianrojas/8783674 to your computer and use it in GitHub Desktop.
Wordpress owner group and permissions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PATH=/path/to/WP/folder | |
echo "chown entire wp folder" | |
chown -R -f www-data:www-data $PATH | |
echo "securing the entire wp folder" | |
find $PATH -type d -exec chmod 755 {} \; | |
find $PATH -type f -exec chmod 644 {} \; | |
chmod 440 $PATH/*.php # verified minimum OK with WP | |
find $PATH/wp-admin -type f -exec chmod 640 {} \; | |
find $PATH/wp-includes -type f -exec chmod 640 {} \; | |
chmod 440 $PATH/.htaccess | |
chmod 766 $PATH/sitemap.* | |
chown -R -f www-data:www-data $PATH/wp-content/uploads | |
chmod 777 -R $PATH/wp-content/uploads | |
find $PATH/wp-content/uploads -type f -exec chmod 660 {} \; | |
chmod 770 -R $PATH/wp-content/upgrade | |
chmod 750 -R $PATH/wp-content/plugins | |
find $PATH -name 'index.php' -exec chmod 440 {} \; | |
echo "Done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment