Skip to content


WordPress Upload Management Tip

A tip for all WordPress users out there who have unwieldy uploads folders in wp-content: take a bit of the chaos out by creating a bit of a hierarchy in your uploads folder!

Here’s what I do:

  1. Create a folder named “uploads” in wp-content.

    Having a separte folder for the stuff I upload allows me to keep things a bit tidier in there. As you probably know, wp-content isn’t in danger of being overwritten when you upgrade WordPress, and so it’s a good place to stash stuff.

  2. Create folders by year inside uploads to store images, movies, etc.

    If you’re like the rest of us normal folks, you aren’t very good at renaming images that you upload. All that stuff takes a lot of work. However, if you create year-based folders inside your wp-content/uploads/ directory, you’ll be able to start to pin down when you used that really goofy image of your cat.

The only issue with this approach is that you have to make sure to have a new folder on hand when the calendar turns over a new year. If you take the time, though, to make a list of things that you should do every time January comes around again, this is a quick-and-easy thing to add to the list.

One last thing: make sure to chmod all these image folders to 777—otherwise, WordPress won’t be able to work with them!

[Thanks to Amy Qualls-McClure for making this suggestion years ago.]

Posted in WordPress.

15 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. In case you didn’t already know about it, the media manager in WordPress 2.0 (which replaces the old upload interface) does this automatically.

    Plus, the “attachments” (as they’re called) get their own WP post-style pages with comments. It’s almost like having a gallery system built in.

  2. I sure didn’t know that. I’ve not touched WP2.0 at all. I’m glad to hear that the Upload interface is much better—it couldn’t have gotten much worse!

  3. Jacob said

    I would say it would be a huge mistake to chmod a directory to 777, since you would be raping yourself in the ass, if a hacker ever came along. In my experience, I’ve never had to chmod a directory for uploading to work. It should still work with 755, since on most servers, you are the owner. There should also be some checks to see if a script has permissions is_writeable is the best way to check for that. If not, then spit out an error saying that permissions were denied or folder doesn’t exist and try to create the folder and try again.

  4. It should still work with 755, since on most servers, you are the owner.

    Well, my experience is certainly counter to yours, Jacob. I just chmod’d the uploads folder here to 755, tried to upload from within WordPress, and I get the dreaded “It doesn’t look like you can use the file upload feature at this time because the directory you have specified doesn’t appear to be writable by WordPress. Check the permissions on the directory and for typos.”

  5. Lara said

    You can upload things through WP? :)

  6. Yeah, on all the servers *I* have dealt with, the web server runs as a different user. The exception would probably be web hosts who run PHP as a CGI process, which allows them to run it through suexec. But when PHP is installed as a module, it executes with the same permissions as the main apache instance, which is typically as the ‘nobody’ user (or a similarly unprivileged account).

    You don’t *have* to make the wp-content directory writable for everything. Most parts of WP that need to write files under there are looking at particular subdirectory (cache, uploads, etc). Just make those writable, and there are fewer security concerns.

  7. Lara: Options –> Miscellaneous. ;)

    Dougal: That’s my experience as well.

  8. Lara said

    What’s the benefit to uploading this way vs. FTP?

  9. The main one would be that you never have to muck about with an FTP client. :) The tool also generates clean, valid markup for you.

  10. Derek said

    I 777′d my upload directory and found some injected .php files a few months later that were spewing out spam into Google. Looks like 777 isn’t safe!

  11. Hello, i have a question: can you upload, let’s say, images, to your WP-content folder via email!? Is there any kind of service or app for that?

    Thanks.

  12. Not that I’m aware of, Luis.

Continuing the Discussion

  1. The Indiana Jones School of Management linked to this post on 12/17/2005

    Another Golden Sombrero

    I don’t know why pulling off a golden sombrero amuses me, but it does.

    WordPress Upload Management Tip
    My Best Music of 2005
    Musiclogging
    Waiting and Preparation

    Heck, I even tossed a fifth one out there after updating some WP-Amazon pl…

  2. Weblog Tools Collection » WordPress Upload Management Tip linked to this post on 12/22/2005

    [...] WordPress Upload Management Tip: If you have a Wordpress upload folder (like my b2-img) that is overflowing with stuff.   [...]

  3. The Indiana Jones School of Management linked to this post on 12/23/2005

    The Power of a Single Link

    Yesterday, I emailed Mark Ghosh, who runs Weblog Tools Collection, to point him to my tip on managing WordPress uploads folders. Mark posted it a half-hour or so later, and it was fun for me to watch the traffic on GFMorris.org go from its usual 10-1…

Some HTML is OK

(required)

(required, but never shared)

or, reply to this post via trackback.