SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Nov 2007
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using just one /images directory for WP?

    I'm going to be starting my second WP blog, only this time instead of having a new directory (folder) created each month for the uploaded images, I'd really prefer just to have one static directory ... preferably called /uploads/images

    If I go into Settings > Miscellaneous, would I:

    - uncheck "Organize my uploads into month- and year-based folders"
    and then
    - "Store uploads in this folder" I would put "wp-content/uploads/images"


    Seem about right???


    (The only thing I've ever uploaded is images, though I guess anything non-image would go there too)

  2. #2
    SitePoint Wizard ryanhellyer's Avatar
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    2,323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep, that sounds right. I generally do this with all of my sites these days.

    Although I'd recommend avoiding the wp-content and images folders and just dump it all straight into "/uploads/" (or similar), it keeps the URL simpler that way.

  3. #3
    SitePoint Zealot
    Join Date
    Nov 2007
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, that's what I'll do with my new blog.

    But how could I do this with my existing blog? (WP 2.5) I could:

    1. uncheck the "month- and year-based folders" thing, and use the default /uploads directory

    2.move all the images to that directory (deleting the old monthly dirs)

    3. go through my posts and trim the /uploads/2008/06 parts from the img src URL's to just /uploads.

    I tried a few, and they work. The problem might be that if I move all images to /uploads, click on the little "add media" icon in the editor, I might have no more images in the gallery, because it would be expecting them to be in the old monthly directories which would be gone (all the images would be in /uploads)

    How would I configure the Media Library/Gallery/what-ever-its-called to now look in just /uploads instead of the old monthly folders?

  4. #4
    SitePoint Wizard ryanhellyer's Avatar
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    2,323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can either manually go through and edit all of the URLs for your images, or you could run a database query to automate the process. If you only have a few hundred posts spread over a long period, then it's probably easier to do it the long way by manually editing each URL. I've used both approaches, depends on which one will be faster to do.

    You need to be careful when doing database queries though. I don't know much about that side of things so have a tendency to break stuff when I try. It's not too hard though, just find a good set of instructions online and you should be able to figure it out.

  5. #5
    SitePoint Zealot
    Join Date
    Nov 2007
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. Editing the URL's in the posts is easy. The problem is moving all of the jpegs out of the monthly folder up to /uploads, and then having the image gallery selection thing point to that directory.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •