How to Change WordPress File Permissions in cPanel

In WordPress by Fathi Arfaoui3 Comments

Sometimes, things seem complicated when you are a newbie to any domain, especially, the WordPress world. One of the biggest problems that bloggers find is how to change WordPress file permissions. It’s not easy if you’ve just started with your blog, and terms like Linux permissions, looks like from another world.

Don’t worry, every blogger, even, the most popular webmasters forget that one day, they were unable to do things easier than changing the file permissions. However, most of them forget to help others who need the help in a step by step guide. In this post, you will learn how to change the WordPress file permissions in easy steps, and you will be able to help others.

The main reasons to open your WordPress files and edit permissions is when you can’t upload images, get the white screen of death or in other cases to set up and correct some issues in your blog. Before starting, it is better to know that every file in your blog has its own permissions setting.

This is a safe method to secure your site and never allow people and scripts from the outside of your blog to edit and change files and especially PHP files.

Changing WordPress file permissions

Using the cPanel file editor

Every web hosting company has a file editor option or similar function to let you view, edit, and update your blog files. All you have to do is to login into your cPanel account, (it’s the software that lets you manage your blog files, your login information are sent the first time when you signed up for a web hosting account).

How to Change WordPress file Permissions

In your cPanel dashboard, you have too many icons and settings, just find the ”Legacy File Manager” icon as the screenshot below:

change wordpress file permissions

As you can see there is another “File Manager” icon, but I highly recommend the second one with the green arrow. The reason is that, with that legacy file manager, you are guaranteed to edit and change the file permissions.

The problem that we’ve found with the first one is that you can change permissions, but when saving the file, the change will back to the old settings. So, you see the changes, but when you refresh the page it turns back. Please note that this issue is special for some server settings that you can’t see. So, use the legacy file manager, as above and avoid problems, it is easy and fast.

When clicking on Legacy File Manager, a pop-up window will be opened, select the “Documents Root” option and you need to check the “Show Hidden Files (dotfiles) box as below:

cPanel File manager

After clicking the “Go” button, you can see all your WordPress and blog files in the next window.

Let’s suppose that we’re going to change the ”Uploads” WordPress directory permissions, which is a common issue in. Sometimes, you get an error with permissions messages caused by the ”Uploader” wrong settings.

The file “Uploads” is located in the “wp-content” which itself located in the public HTML files, so find the “wp-content” file first as below:

open files directory

As in the screenshot, you need to click the small file icon at the left of any file that you need to open. Then, find any subfile you want to edit, in this case, we want to edit the “Uploads” file. Click the wp-content icon and you get the next window:

Locate the Uploads file

Now, you will get the new window on the same page, find “Change permissions” and click on it as the screenshot below:

changing file permissions

When clicking “change permissions”, you get the below window:

check file permissions

Finally, you have the option to check and change permissions on a file as yo wants. Check all boxes to get 777 permissions, this means Read, Write and Execute for all, then, save the change. This is an example of a problem with the “uploads” file, you need also to open the month file and change its permissions to 777. Don’t forget to change back your file permissions to 755 to secure it.

Please note that if you still have any problem with file permission. The solution is setting 777 for both the wp-content folder and the subfolder (uploads in our case) and even more. You have to open the upload file and set 777 for your actual months. This is logical permissions if you set 777 for a subfolder, but, the parent folder is 755. So, you need to set the parent as 777 also and change it back to 755 when the problem solved.

Now, you just learned how to change WordPress file permissions, but, with an easy method through cPanel. It’s easier than using the FTP method, and best of all, most, if not all the modern web hosting providers have a file editor option.

That way, changing file permissions is easier, but only, if you got an error and you should change them. Another important thing to keep in mind is that you shouldn’t set 777 permissions for the following directories and files in WordPress:

  1. wp-admin
  2. wp-content
  3. wp-includes
  4. htaccess

You can edit them if you need, but only for moments and not let them opened to the world with 777. That’s a critical security problem and you have to change them back after fixing the problem, and take care of your blog files and security.

Fathi Arfaoui: A Physicist, Blogger, and the founder and owner of Trustiko.com. He shares Business, Blogging, WordPress, Web Safety, and Blogging tips to build better websites and blogs. Also, he shares online marketing strategies and recommendations.

Comments

  1. Huh … worthless … Every time when I want upload images I should change permission rights from 755 to 777 and when Im done – set back 755 ? Its waste of time and Its not decision.

    1. Author

      Hi, You only need to set it once and forget it. Your ”Uploads” directory records the permissions in the database. With professional hosting, you shouldn’t change permissions or everything, but low-quality servers are what cause the problem.

Leave a Comment