I run a Multisite installation with 10 blogs. All the other blogs work fine except for one where any image that’s uploaded does not show up in the media library. There’s just a blank image instead of the usual thumbnail.
-
Clicking on “Edit” brings you to the “Edit Media” page, but NO image is displayed.
-
Copying the file URL in the “Save” area on the right side of the “Edit Media” page and pasting it into the browser address bar DOES show the image.
-
Clicking “View” from the “Media Library” brings you to a page, but NO image is displayed.
I can’t figure this out because this blog was installed the same way the others were.
I have made sure that:
- File permissions are set to 755 on all folders and files
- The images are uploading to the correct folder wp-content/uploads/sites/”site folder”/”year”/”month”
- Deactivated all plugins and reactivated each one to see if any are causing issues
- Uninstalled and reinstalled the particular blog.
The only thing I haven’t tried was doing something in the database directly, but don’t know where to start.
I had a very similar problem, on a multisite with 8 blogs (2 of them).
In my case I discovered that the the meta_value “_wp_attachment_metadata” of some images were corrupted in the table wp_xx_postmeta. It probably happened due to some plugin, because the last thing I did before this issue was to remove several unused plugins. But reinstalling them didn’t solve it…
Here is what I did:
0 – First of all, I imported the SQL file of the OLD database into a separate database, in order to use both databases in the MySQL server at the same time.
1 – Selected the IDs of all attachments in wp_xx_posts from the old database
where “xx” is the number of the blog with problem.
2 – Selected all meta_id and meta_value in wp_xx_postmeta for the attachments from the old database:
For all image IDs. By copying/ pasting/ replacing the data between an Excel spreadsheet and the notepad it’s easy to create the query for all IDs.
3 – Created a SQL file with the updates of wp_xx_postmeta to be imported to the CURRENT database. This file might be a little bit large, and each line would be something like:
For all images. Again using Excel/ notepad.
4 – Then I executed the SQL file using
mysql -u root -p current_database < sqlfile.sql
When I reloaded the site, all thumbnails and all images were working properly on the media library.