• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Tips and Tricks HQ

  • Home
  • Projects
    • All Projects
    • Simple WP Shopping Cart
    • WP Express Checkout Plugin
    • Accept Stripe Payments
    • WP Download Monitor
    • Easy HTTPS Redirection
    • WP Security and Firewall Plugin
    • WP eStore Plugin
    • WP Affiliate Platform
    • WP eMember
  • Products
    • All Products
    • Checkout
  • Support
    • Support Portal
    • Customer Only Forum
    • WP eStore Documentation
    • WP Affiliate Software Documentation
    • WP eMember Documentation
  • Contact

How to Fix the Unable to create directory Error in WordPress

Home » Blog » How to Fix the Unable to create directory Error in WordPress

Last updated: January 12, 2017





If you are seeing any of the following errors when you try to upload/import media into WordPress’s media library then this tutorial is for you. It will show you how to fix this annoying error.

  • Unable to create directory wp-content/uploads
  • Unable to create directory /wp-content/uploads/ Is its parent directory writable by the server?
  • Unable to create directory wp-content/uploads/2013/02

I personally faced this issue a while back and wrote a quick fix tutorial on this subject. However, a lot has changed since then so it is time to publish an updated version of the tutorial.

There are a few different possibilities for this error to show up. I will try to cover all the possibilities so hopefully one of them will help you fix the issue.

Fix #1: Update/Change the Uploads Directory Settings

This is the easiest option to try and solve this error so you should try this one first.



  1. Log into your WordPress admin dashboard
  2. Go to Media Settings menu (Settings -> Media)
  3. Enter wp-content/uploads in the “Store uploads in this folder” text box
  4. Save the changes by hitting the “Save Changes” button and you are done

wp-media-library-settings-screen

The important thing here is to make sure you only enter the following in the “Store uploads in this folder” field:

wp-content/uploads

Fix #2: Manually Change the Folder Permission

If the above fix doesn’t work then try this option. This method requires you to change the file/folder permissions on your server. If you don’t know how to do this then read the tutorial on how to change permissions.

  1. Change folder permissions on the wp-content directory to 775 and try the upload again
  2. If it fails, change the permissions to 777 and try again
  3. if it still fails then do step 1 and 2 for the “wp-content/uploads” directory too

Once you can successfully create the folder and upload the media, be sure to return the permissions on wp-content directory to 755 (your folders should have a permission of 755 for security reasons).

wp-content-folder-permission-change

Fix #3: Use This If Your Server is Using Ubutu

The webserver (Apache) runs as user www-data and group www-data by default on a Ubuntu system. If the files/folders are not owned by this user (www-data) then the webserver will be unable to write changes to them.

Change the filesystem permission on the folder (where the web application wants to write to) to the “parent directory” as mentioned in the error message.

For example, do (prepend with sudo if you’re not the current owner and need to elevate your own permissions in order to do it):

chown www-data /path/to/directory

to make www-data the owner which makes it writeable usually, or another approach via groups:

chgrp www-data /path/to/directory
chmod g+w /path/to/directory

Fix #4: Try This If Running PHP in Safe Mode

If your server is running PHP in safe mode then know that it won’t allow you to create files or directories if your PHP scripts and upload directories belong to different users. So try one of the following solutions:

  • Change the owner of scripts and upload directories (your hosting provider can do this for you)
  • Disable PHP safe mode (your hosting provider can do this for you)

Fix #5: Use This for XAMPP (LocalHost Installs)

If you have installed XAMPP to run WordPress on your local PC for testing and you are seeing this error then try the following.

Reset the ownership of the WordPress instillation to nobody. You can do this by running the a command in the command line/terminal.

  • Windows System: Start -> Programs -> Accessories -> Command Prompt
  • Mac: Applications ->Utilities -> Terminal
The command you need to run is the following (change “wp” to the actual directory name in your installation):

sudo chown -R nobody:staff /applications/xampp/xamppfiles/htdocs/wp

Hopefully one of the above solutions should help you fix the unable to create directory error in WordPress.

If none of the above solution works then maybe it is time to look for another hosting provider for your WordPress site.

Please feel free to share any other techniques/fixes for this error in the comment section below.

Related Posts

  • How to import WordPress SQL database backup file without having ‘create new database’ privileges in phpMyAdmin
  • What Would You Do If Somehow You Lost all Your Blog’s Content?
  • How to Add Widgets to WordPress Theme’s Footer
  • How to Fix the Character Encoding Problem in WordPress

Wordpress how to,  Troubleshooting,  Unable to create directory error,  web masters,  WordPress Tweaks

Reader Interactions

Comments (33 responses)

  1. afifassihab says:
    July 14, 2020 at 11:30 am

    I use “chmod 777 folderdirectory/wp-content -v” it’s work on Linux Mint. Thanks for the tutorial.

  2. David Scott Lynn says:
    February 11, 2020 at 10:26 pm

    Thank You SO Much!

    I’ve been struggling with this problem for over a YEAR! Updraft Backup would NOT work the whole time, so I had to manually do backups, as other backup solutions would not work either. Other Themes (the now deprecated Aspen, replaced by Weaver Extreme) and plugins (Main WP Child) had similar issues.

    I tried your Solution # 2 first, resetting permissions, and then I tried Solution #1. I think I’ve tried the permissions reset a number of times in the past, and did not work, so it might have been #1 that saved the day. But not thinking to be sufficiently scientific about it (I just wanted it FIXED) I tried permissions first, then did settings/media, but did not turn permissions back down before trying #1.

    Sorry about that!

    Regardless, this has been a BIG help! Your site is bookmarked and I’ll now look for what else you’ve got too.

    Thank You Very Much & Take Care,
    David Scott Lynn

  3. Carlos says:
    February 6, 2020 at 7:24 am

    None of the above suggestions fixed the issue I was having. I am currently running XAMPP installation on a local host. I tried the following command sudo chown -R nobody:staff, however, it gave invalid user. I replaced nobody:staff with the PC user of the machine but that did not help either. Any suggestions would be greatly appreciated as I’m still dealing with the problem,

  4. Erik says:
    January 31, 2020 at 10:44 am

    Came across this in the serps, my problem was solved within the minute. Thanks a lot for saving me a lot of time (presumably :D).

  5. Chuga says:
    March 16, 2019 at 3:21 pm

    Fix 1 worked for me at chugabags. After i had checked so many forums

  6. dlajoie says:
    February 28, 2019 at 1:20 pm

    Fixed with #1, thank you so much for your tutorial….such a simple fix for an aggravating problem.

  7. Josh says:
    July 25, 2018 at 3:48 am

    Solved it with Fix #1 tank you

  8. Paulo Mendes says:
    April 13, 2018 at 11:08 pm

    Thanks so much for Tip #3; it was unreasonably effective

  9. Gianluigi says:
    February 18, 2018 at 3:24 pm

    Fix #1 worked perfect!!!.
    Thanks

  10. Abdul Gafur says:
    November 21, 2017 at 10:40 pm

    Fix #2 working for me, thanks you 🙂

  11. Sledge says:
    August 31, 2017 at 8:58 pm

    Thank you so much #1 worked perfect and I was up and running in 5 minutes. So great to have great help when you need it and not search for hours.

  12. Spencer says:
    July 30, 2017 at 5:50 pm

    This also threw me for a loop years ago when I set up my site, but the solution was different. If you have a new or especially secure implementation of many ftpd server packages, the ability to write is disabled by default. For example, vsftpd disables being able to write to the file system by default, regardless of permissions. You have to enable it. Ensure you have set this up or your hosting provider has. vsftpd.conf for example:

    # Uncomment this to enable any form of FTP write command.
    write_enable=YES

    I switched to ssh and keys since then but I I’ll never forget that lost hour or three…

  13. Renee says:
    January 16, 2017 at 7:09 am

    Fix #1 worked beautifully. I had recently changed my hosting and I was trying to upload a plugin when I got that “Unable to create directory… message” I thought I was about to end up spending forever trying to figure it out, but within about 15 minutes I found this site and saw what your readers were saying.

    They were right. Thank you so much. Plain english, wp beginner can understand.

  14. Lily says:
    November 15, 2016 at 1:55 pm

    Thanks you so much!
    I have been searched for solution for a whole day, and Fix #5 really fixed my problems.

    谢谢!

  15. zac says:
    November 10, 2016 at 6:41 am

    If you need to alter the permissions of ‘wp-content’ folder to 777 to make things work then you need to understand that permissions need to be tweaked.
    You cannot keep 777 which will allow any user to access the folder.

    So always keep your permission to 755 but check the ownership of the folder.
    The owner should be the owner of the service executing the script.
    In the case of a conventional apache service we would have the apache user.

    So,
    $ sudo chown apache:apache -R wp-content

    This should help out!

  16. Hector says:
    November 8, 2016 at 2:21 pm

    Thanks fix #1 worked perfect!!!

  17. S. Chidananda says:
    August 8, 2016 at 3:02 am

    Thank you very much. I had ubuntu and my www folder was set to “root” user. I changed it to “www-data”. It worked like charm.

  18. Renerio says:
    April 9, 2016 at 12:51 am

    I knew there was something to it about changing between hosts. I just didn’t know where to look! Obviously Fix#1 from you fixed it.

    Thank you for this!

  19. ankit says:
    January 25, 2016 at 1:13 am

    Thanks so much for taking the time to share your knowledge. This problem was driving me crazy as it was on a subdomain installation I used your Fix #1 above and all my frustration and stress just simply disappeared. Thanks again for sharing your knowledge.

  20. Sharaj says:
    August 17, 2015 at 3:02 am

    Thank you so much. The First one worked for my website. Appreciate your cooperation. 🙂

  21. Thanks says:
    July 26, 2015 at 4:40 am

    Thank you very much. This was the solutions (Fix #1) that worked for my localhost installation with xampp on Windows 7. It’s a pitty that most solutions that you find on google are all about editing code (define(‘FS_METHOD’, ‘direct’);) to the wp-config.php and changing permissions.

  22. Sin says:
    April 8, 2015 at 10:06 pm

    I had the same issue with the latest wp-update. WP nor plugins would auto-update.
    None of the solutions mentioned here worked. What did work was:
    – deactivate all plugins,
    – put the rights all to 777,
    – check for the wp-config (change the rights settings to 0777 there as well)
    – do a manual ftp upgrade of WP,
    – do a auto-upgrade of the still deactivated plugins,
    – reactivate the plugins and
    – put the rights to the previous settings (folders, files and wp-config).
    I don’t know why this works, but it is the second site that had this problem, and it worked twice.

  23. Glenn Bronner says:
    February 28, 2015 at 2:21 pm

    Thanks so much for taking the time to share your knowledge. This problem was driving me crazy as it was on a subdomain installation I used your Fix #1 above and all my frustration and stress just simply disappeared. Thanks again for sharing your knowledge.

  24. Archie says:
    January 2, 2015 at 4:05 pm

    Thank you for publishing this. I found the problem emerged when I changed webhosts. The media settings were specific to my previous host.

    i.e /oldusername/website/wp-content/uploads

  25. Rocky says:
    December 5, 2014 at 8:35 am

    It worked like a charm. I was wondering for long for this. Thanks

  26. sikander says:
    November 10, 2014 at 4:46 pm

    Fix #1 fixed the problem for me.

    Thanks!

  27. Scott says:
    July 28, 2014 at 12:03 pm

    Thanks for the options to fix this. I had installed an old version of WP a while ago and then updated it recently… after which I was unable to upload images. Your Fix number #1 solved my problem in an instant!! After I spent an hour or so looking around for a solution elsewhere. Many thanks!

  28. Mitch says:
    April 7, 2014 at 9:08 pm

    Thank you for the fix! Worked like a charm.

  29. sue says:
    September 26, 2013 at 6:12 pm

    Thank you for taking the time to post the tips.
    I did your recommended fix #1 which required me to delete a single extra backslash at the beginning of “(/)wp-admin/uploads” and that fixed the frustrating problem. Cheers!

  30. Amy says:
    June 10, 2013 at 6:17 pm

    Thank you so much for this article, fixed my problems right away!

  31. Sam says:
    June 9, 2013 at 5:54 am

    Thank you very much for this great tutorial. This was easy to understand and i was able to fix this directory creation problem that has been frustrating me for hours.

  32. Arthur says:
    May 21, 2013 at 5:59 am

    Brilliant Site..Thanx, went through a lot of site but I couldn’t get the help I needed. Found it here…Keep up the good work…

  33. Alan says:
    May 9, 2013 at 6:59 am

    If your server is running PHP in safe mode then know that it won’t allow you to create files or directories if your PHP scripts and upload directories belong to different users.

Leave a Reply

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

Primary Sidebar

Featured & Popular Articles

Video Answers to Top WordPress QuestionsWordPress Optimization Tips and Tricks for Better Performance and SpeedEssential WordPress Security Tips - Is Your Blog Protected?WordPress Simple PayPal Shopping Cart PluginTop 15 Search Engine Optimization (SEO) Techniques I Forget to DoList of the Best and Must Use WordPress PluginsHow do I Start a Blog and Make Money Online?Good Domain Name Picking Tips for Your Blog SetupFind Out Which WordPress Web Hosting Company Offers the Cheapest and Reliable Web Hosting Solution

Featured WordPress Plugins

WP Express Checkout Plugin
wordpress estore plugin
wordpress membership plugin
wordpress affiliate plugin

Recent Posts

  • How to Use Browser Developer Tools to Inspect Elements and [...]
  • Accept Donations via PayPal from Your WordPress Site Easil [...]
  • Buy Now Button Graphics for eCommerce Websites [...]
  • Subscription Button Graphics for eCommerce Websites [...]
  • Adding PayPal Payment Buttons to Your WordPress Sidebar Ea [...]

Comment & Socialize

  • @Rob, We have just released ...
    - admin
  • I installed the plugin a co ...
    - Rob
  • @Sebastian, We've released ...
    - admin
  • I've used this plugin on a ...
    - Sebastian Djupsjöbacka
  • @John, this plugin doesn't ...
    - admin

Check out our solutions

View our WordPress plugin collection and start using them on your site.

Our WordPress Solutions

Footer

Company

  • About
  • Privacy Policy
  • Terms and Conditions
  • Affiliate Login

Top WordPress Plugins

  • Simple Shopping Cart
  • PayPal Donations
  • WP Express Checkout
  • WP eStore
  • WP eMember

Blogging Tips

  • How to Start a Blog
  • Selecting a Good Domain
  • Cheap WP Hosting
  • WP Video Tutorials
  • Simple SEO Tips

Search


Keep In Touch

Copyright © 2025 | Tips and Tricks HQ