WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a multisite that was set up on WordPress 3.4. That means that uploads for sub-sites are stored in wp-content/blogs.dir/{blog_id}/files and are served through ms-files.php.

In WordPress 3.5, ms-files.php was disbanded completely for new installs and uploads are stored and accessed at wp-content/uploads/sites/{blog_id}.

Is there anyway I can switch my install from the pre-3.5 way of serving/uploading files to the new way? I would like to continue serving uploads through files/ for current blogs, if possible.

share|improve this question
up vote 6 down vote accepted

In theory:

  1. Move images from blogs.dir/SITENUM/files/ to /uploads/SITENUM/ (or make an alias)
  2. Edit all sites so they don't look in /files/ but in /uploads/SITENUM/
  3. .htaccess, remove the ms-files.php line
  4. Search/replace each posts table for each site, changing /files/ to /uploads/SITENUM/

A walk-through can be found here (dumping ms-files), this is not a trivial hack! It involves command-line usage, sql, and using a mu-plugin.


share|improve this answer
May I recommend editing the chosen answer to suggest /uploads/sites/SITENUM to stay coherent with upstream defaults? – lkraav Dec 19 '15 at 22:28
There's an additional step: you should add ms_files_rewriting key with an empty value to wp_sitemeta. site_id = 1 – lkraav Dec 20 '15 at 0:23

I just opened a ticket about supporting old /files/ links: http://core.trac.wordpress.org/ticket/23755#comment:1

There is a solution in that ticket which requiring editing ms-files. I am not happy with editing core but i dont wanna break any working sites with defining BLOGUPLOADDIR networkwide. I hope it helps for old /files/ link and i hope we can find a better way without editing core.

share|improve this answer

Your Answer


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.