What is WordPress Permissions and Their Optimal Settings

When you’re editing your WordPress site, you might stumble upon folders and file permissions. Now you might wonder what that is and how crucial it is for your site.

This article will explain what they are and give you the recommended permissions and steps to change them.

A straightforward way to edit your permissions is by going to your WordPress hosting’s control panel and head to the file manager. More will be explained below.

Let’s get started.

What Are WordPress File Permissions?

WordPress File Permissions are a set of rules that control how different users can access the files on your WordPress server. Three types of users can access your files, those are:

  • User – who is the administrator of the WordPress site.
  • Group – a few people who have roles in your site, like editor, contributor, or subscriber.
  • World – The general public.

You’ll need to give them different permissions levels, which depends on the level of trust you have with them. The three levels of permissions are:

  • Read – Users can read the contents of the file.
  • Write – Users can edit the file.
  • Execute – Users can run programs and scripts inside the file.

What Do the Number and Letters in File Permissions Mean?

File permissions come in a set of three-digit numbers. To set the permissions correctly, you need to know what each number represents.

The primary number meaning denotes the level of permission granted to the user, such as:

  • 0 – No access
  • 1 – Execute
  • 2 – Write
  • 4 – Read.

Then the other numbers are a combination of the basic ones, such as:

  • 3 – 2+1, Write and Execute.
  • 5 – 4+1, Read and Execute.
  • 6 – 4+2. Read and Write.
  • 7 – 4+3, Read, Write, and Execute.

 

Optimal Settings 300x190 1

While you’ll mostly encounter the number format, you might also see file permissions in the form of letters. Here’s what they mean:

  • r = Read
  • w = Write
  • x = Execute
  • (hyphen) = No access

Recommended File Permissions in WordPress

Since you shouldn’t grant all three groups’ permission to be 777 because this leaves your site vulnerable to hackers, and you can’t give 000 access to everyone because it will crash your WordPress site.

Here are some of the recommended file permissions. The order starts from user, group, and the world:

  • wp-admin: 755
  • wp-config.php: 644
  • .htaccess: 644
  • content: 755
  • All other files: 644

How to Edit WordPress File Permissions

There are three relatively simple ways you can edit WordPress file permissions. Let’s take a look.

1. Using Your Web Host

When you’re using a web host, you’ll usually be able to edit permissions using either cPanel or other control panels that your web hosting uses.

Here I’ll explain using cPanel since the majority of web hosts are using it. The process is straightforward. All you need to do is go to your cPanel File Manager, right-click on the folder or file you want to edit, and click on Change Permissions.

2. Using FTP

FTP (File Transfer Protocol) is software that helps you connect to your WordPress site’s server to access the folders and files inside. To be able to run FTP, you’ll need to download an FTP client. A popular choice is Filezilla.

Once you’ve downloaded the FTP client, enter your FTP credentials and connect to the server. Then on the right side of the client will be your files and folders. Right-click on the file or folder you want to edit and click on File permissions.

Go ahead and change the permissions to your liking and click OK to finish.

3. Using Your Preferred SSH Client

SSH (Secure Socket Shell) is another software that helps you create a secure connection to your WordPress site’s server. To be able to run SSH, you’ll need to install an SSH client. A popular choice is puTTY.

  • To edit WordPress permissions for folders, simply enter the following command:

find /path/to/your/wordpress/install/ -type d -exec chmod 755 {} \;

Change the 755 permissions to whichever level.

  • If you want to change the permissions of all files, type in the following command:

find /path/to/your/wordpress/install/ -type f -exec chmod 644 {} \;

Change the 644 to whichever level of permissions you want to give.

  • To change permissions for wp-config.php.file or .htaccess, you can use the following commands:

chmod 600 wp-config.php OR chmod 600 .htaccess.

Again, change the 600 to the permission you want to grant.

Why Are WordPress File Permissions Important?

Simply put that, file permissions control what different users can do to your files on your server. As we mentioned earlier, you can’t set all your file permissions to 777 because anyone on the internet can do various things to your files, even deleting them.

You also can’t set the permissions to 000 because no one will have access to the site. Thus it can’t function properly and crash. File permissions are there, so the appropriate type of users has the proper access to your website.

Conclusion

Now you know what WordPress permissions are and the optimal settings for them. All that’s left to do is for you to check and make sure that every type of user has the appropriate permissions.

Good luck!

No tags for this post.

About The Author

Leave a Comment

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

Scroll to Top