Have a Question?

If you have any question you can ask below or enter what you are looking for!

WordPress media uploads fail after a site is moved or cloned

Description

After a WordPress site is moved into a different hosting account or moved in some way, media uploads may stop working if WordPress is still using a custom upload path that points to an old location.

This typically affects uploads in the Media Library and any feature that tries to save files into the WordPress uploads directory (e.g. plugin & theme updates).

You may see an error similar to: “Unable to create directory uploads/YYYY/MM. Is its parent directory writable by the server?” when uploading an image or other media file.

Although this message can suggest a permissions problem, the most likely cause is an incorrect upload directory set in WordPress’ Media Settings. The path still referenced the previous hosting account, so WordPress was trying to save uploads to a location that no longer matched the site’s current account.

This can happen after a migration or clone (e.g. creating a staging site), especially where the “Store uploads in this folder” setting contains an absolute server path.

Solution

  1. Log in to the WordPress admin area.
  2. Go to Settings and then Media.
  3. Check the “Store uploads in this folder” setting.
  4. If it contains a custom server path from a previous hosting account, remove the custom value.
  5. Save the settings so WordPress reverts to the default uploads location.
  6. Try uploading the file again through the Media Library.

WordPress will then use its default uploads directory under wp-content/uploads