Digital Media Insights for Business Owners

Upload folder is not writable. Export and file upload features will not be functional.

WordPress is a fantastic CMS platform. It is preferred by many clients and therefore as developers we end up using it for all sorts of projects. Sometimes, things go sour though. If you have moved a WordPress site from development to staging to production, you have run into funny problems such as the little red message called: “Upload folder is not writable. Export and file upload features will not be functional.”

Of course, this message is not only about the message, but also about the fact that the installation won’t allow you to upload any files. Well in this post with this simple solution you won’t have that problem anymore.

How not to fix it.

So first I would like to start by saying how not to fix this problem. When I had the problem, my first impression was that it had to do more with ownership than it did with permissions – which is true, however, you shouldn’t fix it by attempting to modify permissions. Let me explain.

The problem happens because your server’s user and group can write to your WordPress Upload Folder in order to either 1. Create the folder for the month’s uploads or 2. Upload a particular file to that folder. Of course you would think that the user should be able to do so since the owner of the site should also be the same owner of the FTP account that you used to upload the files, right? It is correct. However in some cases, in some hosts it is different. In other words, some hosts use a specific user account to act as the server and another one that you use in FTP or SSH, etc. In other words, you are not acting as the same user even if you think you are.

You could try to make both be the same, however that would simply be too painful.

How to fix it.

In many occasions this can be fixed by doing the following:

1. Make sure that the user and group that owns all your WordPress files is consisten across your site. Be careful here because you may accidentally change more than what you should and therefore make your server return an error. If you do, don’t freak out! You can fix it with no problem.
Before you begin, note the user and group of your httpdocs/ or public_html/ or www/ (BE SURE TO NOTE THIS we are going to call this realuser:realgroup).
So let’s say that you installed WordPress in yourdomain/httpdocs/ so simply run the following TWO commands:

				
					chown -R yourftpuser:yourftpgroup httpdocs/ 
chown realuser:realgroup httpdocs/
				
			

*Please note that in the second command I didn’t use -R (for recursive).

The first command changes the ownership of the files in the httpdocs/ folder recursively.

The second line changed the ownership to the actual httpdocs/ folder itself (not to the folders and files within it.)

Ok great. Now we have ensured that your installation is under the right ownership. Let’s go ahead and fix the permission problem.

				
					cd /wp-content 
chmod -R 777 uploads/ 
chmod -R 755 uploads/
				
			

* You may be thinking now, WHAT? Why would you first change to 777 and then immediately change to 755.

The reason we need to reset the permissions from the perspective of the SSH user (root) and we do that by giving 777 permissions, then when we change them to 755 then it defines all permissions as read, write and execute for the user, read and execute for group and world – which is what we want.

NOTE: I have seen some posts that recommend setting permissions to 777 and forgetting about it – I recommend against that. You don’t want every user in your server, to have write access to your folder.

Tha’t it friends, now enjoy uploading files to your WordPress installation. Let me remind you that of course this works for both simple WordPress and Multisite – in fact I tested it with Multisite and worked accordingly.

If you liked this post, please take a second to comment below, it would take only a couple of seconds!

Do you have issues with your WordPress installation or with your website that you simply don’t want to or don’t know how to fix? If that is the case, contact Merkados today.

Say: "Hola" to your new clients.

Follow us on Social Media for more Tips & Tricks.

Other Posts You May Enjoy