Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Have been developing a site and noticed that all of the media files were being saved in the default WP year/month/day rule in the wp-content/uploads directory. I decided to change this to assets and unchecked the option to store these in the date format.

End goal here is to bring over all of the existing media to use that new path. I extracted all of the sub-folders into a flat list of files and then copied them over to the assets directory.

Then, I tried editing the GUID for attachments to the new location -- still, no dice. Right now, it's referencing those old files as assets/2012/08/01 instead of the new format.

I've verified the option for storing media files in the date subdirectories is unchecked -- is this stored in a transient/cache somewhere that I can reset? I'm more than comfortable going through and running the needed SQL queries to update any post content with these in them, but a bit confused on why the URLs on the front-end are not updating to just assets). Thanks!

Update

New files are being stored just in /assets and not the sub-date folders... really confused on these old file paths not working.

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

The relative path, including the date directories, is stored in the postmeta for the attachment's post, using the _wp_attached_file meta_key.

If you examine the data for that key, you'll find that the meta_value is 2012/08/example.jpg or something similar to that. This is used to build the URL.

share|improve this answer
    
Nice, thanks a lot! –  Zach Dec 19 '13 at 17:22
add comment

Go to your dashboard settings > media wp-admin/options-media.php under the file uploads heading place your new path in the associated field

share|improve this answer
    
Already done that as described in my question - the old file URLs are not updating on the front-end (even with a GUID update via the DB). Maybe they're stored in a transient somewhere based on the original file's creation date and then based on when that URL option is saved and new files are uploaded, take on that new URL path. –  Zach Aug 17 '12 at 14:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.