Questions? Feedback? powered by Olark live chat software
Knowledgebase
Author Avatar

Resetting Default Wordpress Permissions

Written by: on 25 January 2016 12:04 PM 25 January 2016 12:04 PM

Reset default wordpress permissions after a migration of uploading a wordpress website. Learn & do it yourself.

PERMISSIONS FOR WORDPRESS

After a migration of uploading a wordpress website if you are getting errors with regards to file permissions, or if you think the previous settings may be insecure (e.g. you get hacked regularly), you should make sure you reset the permissions appropriately.

To do that first SSH into your server. 

Then change directory into the users public_html folder by typing (replace username with the correct username for the site):

cd /home/username/public_html

Ensure you ARE in the correct folder or you risk breaking all permissions on your VPS making it unusable. You can see in SSH it will show you something like this:

root@vps [/home/username/public_html]#

If it doesn't show you are in the public_html folder for your user then do NOT run the below commands.

To reset permissions type

sudo find . -type f -exec chmod 664 {} +
sudo find . -type d -exec chmod 775 {} +
sudo chmod 660 wp-config.php

This works well for servers setup with the default and cPanel recommended PHP configuration of DSO, suexec and mod_ruid2.

 

(0 vote(s))
Helpful
Not helpful