24

In my wordpress, I tried to upload my images by media uploader but it says "couldn't create directory wp-content/uploads/2016/09". Then I create the folders correctly. And now when I tried to upload my files by media uploader, it says "couldn't move to directory wp-content/uploads/2016/09". Finally I uploaded my images in the folder and then checked the media library and the media library saying "no media founds".

Why is it happening?

2
  • 1
    This could possibly be folder permission issue. Please check this to confirm. Commented Sep 25, 2016 at 10:08
  • 1
    In other words, to show up in the Media Library, files must be BOTH physically on the server AND also registered in the database. If either requirements art missing, they wont show up. If you cant upload images from the backend, it's most likely a permission issue. Try to set the 2016 folder to 777 and try again. If it works then ask your hosting for support on the issue, or use a plugin that help with SFPT/FTP connections to the server.
    – The J
    Commented Sep 26, 2016 at 3:47

3 Answers 3

14

Just by uploading files into the wp-content/uploads won't show up in the Media Library , those media ID's needs to be there in the database to show up in the Media Library.

If you already have files in the uploads folder and want to add them into the database, you can use this plugin to add files from server.

But this is not the correct solution instead fix the permissions issue for that uploads folder.

7

You can use Media Sync for new updated plugin for the year 2020. The plugin description reads

You can scan all files that are in “uploads” directory and see which ones are actually in Media Library and which ones are just sitting there. Then you can select those that you want to import to database and therefore make them available in Media Library.

1
  • 1
    tried this, it solved my issue
    – Guerrilla
    Commented Jul 17, 2021 at 19:47
-2

Media files exist in upload folder but not showing up
Simply Paste this code in wpconfig.php and save it all is done :) but exactly where to paste?

define( 'UPLOADS', 'wp-content/'.'uploads' );

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