How can the temporary update directory be changed?

When a plugin, theme, or even WordPress itself are updated, it downloads and saves the files (.zip, extracted files, etc.) to wp-content\upgrade. This is not always desirable.

For example, I run a portable version of WordPress from a flash-drive, so I don’t want it using the flash-drive for temp files. I would prefer it to put temporary files in the system’s temporary directory.

I already changed the temporary (upload) directory in php.ini as so:

upload_tmp_dir = ${Temp}

This works for regular PHP scripts, and while I’ve seen a couple of pages which seem to indicate that WordPress (3.0+) should use the default (upload? download?) temporary directory, it is ignoring it and still putting the temporary files in wp-content\upgrade.

How can this be changed?

1 Answer
1

Impossible. The path is hard coded in many places (wp-admin/includes/update-core.php for example).

I think this is worth a Trac ticket, if there isn’t one already. We can move the directories for plugins, themes and mu-plugins. This is the last thing why we need a wp-content directory at all.

Update

There was a short discussion in ticket #25153. The result is a wontfix, because the upgrade directory enforces the existence of a wp-content directory (whatever its name is in your setup), and that should be kept in case the core needs to add further directories here later, for example wp-content/libraries/.

You can set the upload directory and the wp-content directory to the same physical directory via wp-config.php constants. This should be clean enough for time being.

Leave a Comment