A maintenance event to our servers or software is in progress. It may not affect you. Select the link on the right for details. Learn more

Media is not showing up in the WordPress Media Library Print

  • 4

Problem Description

You have uploaded media or copied media files to the wp-content/uploads folder using SFTP/FTPS or the Plesk File Manager rather than using the WordPress Media Library

When you upload media using the WordPress media upload function to the Media Library it does two things:

1. Creates an entry in the WordPress database that holds additional data about the media file, and
2. Uploads the actual media file to the wp-content folder

Those two things work together to ensure the media files all appear correctly in the Media Library and connect properly to posts or page featured images. When you upload the files manually and don't do so through the media library, part (1) above does not occur and so the media does not appear in the WordPress Media Library nor does it connect the media to featured images.

That said, the media files *will* still show on pages and posts. They just won't be selectable to insert into pages and posts from this point forward.

Resolution

If you only wish to ensure those media files show up in the WordPress Media Library, the Add From Server plugin will allow you to re-import that media. However this will create new media IDs in the WordPress database. This means that if you're attempting to manually transfer media from an older version of the site, using this plugin will likely not fix featured images that are attached to posts and pages.

When transferring media between WordPress sites, an alternative solution is to use WP-CLI to import those media files. Details on how to use wp-cli with Plesk here, and how to import WordPress posts with media together here (not media on its own though -- you will need to erase any posts you already imported and re-import them with wp-cli).

Advanced / Sideloading: You can also use wp-cli to import media files into the Media Library (sideloading) and even attach them to posts and set them as the featured image, but this comes with the massive caveat that the import would need to be scripted to loop through all media files and import them into the media library. Furthermore to attach them as featured images, you would also need to have a list of media filename <-> post ID relations to feed to the import command.

 


Was this answer helpful?

← Back