WordPress.org

Ready to get started?Download WordPress

Forums

Change location of Media Library (14 posts)

  1. WayneSmallman
    Member
    Posted 5 years ago #

    Hi guys! Is it possible to use a different folder for the source location for the Media Library?

    I've been using my own folder for images (for various reasons) for quite some time. And it's just not practical to change all of the images references right now.

    Is it possible to change the location of the Media Library, or is it a hassle?

  2. hotkee
    Member
    Posted 5 years ago #

    You can change it at any time - the existing posts will continue to reference the old locations - new uploads will use the new location.

  3. WayneSmallman
    Member
    Posted 5 years ago #

    That's good to know, but I need to know how.

  4. hotkee
    Member
    Posted 5 years ago #

    Just go to settings ->Miscellanous and enter something for

    "Store uploads in this folder" - for example "images"
    "Full URL path to files (optional)" - for example "/images"

  5. WayneSmallman
    Member
    Posted 5 years ago #

    Yeah, I tried that before and it doesn't work.

  6. hotkee
    Member
    Posted 5 years ago #

    How do you know it doesnt work?
    - the full path must be correct for your own server and I assume you clicked on update once you make that change in settings.

    you also have to make sure the new folder say "images" exists, if it doesnt you have to create it yourself.

  7. WayneSmallman
    Member
    Posted 5 years ago #

    I've been using a folder called: "images" for my images for years. I also added the full path to the folder, too.

    I've checked with the Media Library tab and there's nothing listed.

    Just so you know, I'm not a noob! I'm a PHP developer of over 6 years...

  8. hotkee
    Member
    Posted 5 years ago #

    But if you are using "images" already then thats not changing the location.

    The defualt is wp-content/uploads so I assume you changed it to images some time ago?

    Did you at some point to do an Export and Import of WP?

    I did a few days ago because I wanted to get rid of gremlins in the system. When I did that the import - it failed to bring across image links (post image meta data) - in essense it lost all history of image attachments. Nothing showed up in the Media Library and I had to manually frig everything.

  9. WayneSmallman
    Member
    Posted 5 years ago #

    "But if you are using 'images' already then that's not changing the location."

    From the point of view of WordPress, it's a change of location; "images" is distinctly different to "uploads".

    "The default is wp-content/uploads so I assume you changed it to images some time ago?"

    I tried it, it failed so I left it. Successive updates have reverted it back to the default.

    "Did you at some point to do an Export and Import of WordPress?"

    My blog was imported from Blogger, which is why I have my own images folder.

    I could export my database and do an search & replace against the image locations, then import the updates back into the database, but then I'd lose all of the SEO goodness I've accrued relating to all of the images.

    So what did you do to get the Media Library to recognize the images?

  10. hotkee
    Member
    Posted 5 years ago #

    My problem started with my install not working some plugins and I wanted to clean things out completely.

    So I imported wp to a file using the export I had got through the wp menu.

    That file lost the post image meta data.

    You could if you have some knowledge look at the postmeta table to get the missing attachment records into the new database (I kept a backup of the db amd still have it).

    Problem is more deep rooted - as well missing the meta data, wp 2.5.1 onwards started to use different naming conventions for thumbnails.

    In the end I decided to re-upload individually all the images per post and re-embed (to be perfect). In this way I have in affect started with a clean database and kept it clean, the old files which are in another location can then be removed - my images are divided by year/month so at the moment everything goes to 2008/07 even though orignals were in other folders.

    Alternative was to take missing postmeta data from the old db to the new db - but then its not clean going forward given the naming convention changes.

    Its not nice but I needed to re-do everything so I could get a plugin I wrote to work properly to (just a simple random image gallery plugin).

  11. WayneSmallman
    Member
    Posted 5 years ago #

    I have over 500 images and 580 articles — so I don't think I'll be doing that! :-D

    I'm surprised this has been overlooked by the WordPress developers.

    There's no way for me to go back to anything because I had no idea what WordPress would have been doing at the time. So any data from the import is gone permanently.

    I'll see if I can figure something else out.

    Thanks for your time!

  12. Anonymous
    Unregistered
    Posted 5 years ago #

    I'm having this same problem.

    I have nearly 100 articles and 300+ images. I've always used an 'images' folder as well.

    I need a way to change the path. I'm very surprised this was overlooked.

    Thanks.

  13. Japh
    Member
    Posted 5 years ago #

    Hi folks,

    As this thread occurred approximately 6 months ago, likely you have all moved on or discovered solutions. However, in case you are still wondering how to do this, you were so close!

    It seems to me that you were changing the path, but not actually creating the database entries for the images. WordPress creates an entry in the posts table for images uploaded through WordPress.

    There is a plugin, however, that adds a "Add From Server" tab, so once you've changed your image upload directory from 'wp-content/uploads' to 'images', you can just add the images through this plugin.

    The plugin can be found here: http://wordpress.org/extend/plugins/add-from-server/

    Hope that helps either you guys, or the next person who comes along with the problem.

    Cheers,
    Japh

  14. wpfreak321
    Member
    Posted 5 years ago #

    Hello,
    I have similar question : how can i change path of Media library for my mounted partition ?
    I dont have troubles in all mediastreamers like subsonic,jinzora,zina and more. I get only path for media in my config.php - some like /mnt/media/music.

    Cheers wpfreak

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.