Wordpress - Images not showing up in Media Library - wordpress

for some reason, WordPress images not showing up in Media Library since yesterday moreover when I try to upload an image is getting the error "An error occurred in the upload. Please try again later.
I tried everything I read, fix permission, update everything, disabled all plugins, enable default theme, install some plugins like Hotfix, and Media sync, etc upgraded PHP with no luck,
when I'm going to the Media library the image is like grid view
when I'm going to list view it shows blank thumbnails without the option to delete them.
list view
could you please help?

My guess is the allowed memory limit for PHP needs to be increased. If you have access to update this values, consider updating it. It's found in your php.ini files. The default is usually 64MB. You could try adding multiples of 64 MB. So 256MB should be fine. Good luck!

Another update is that when in the library is selected “All media items” and “all dates” not showing anything if i choose a specific month it shows the media.
Moreover if i delete the folders from the upload it still available in the gui bit without photos.
But im still facing issues to upload or to see all the media.

After my deeper investigation i figure out the following the "no title" created every time im trying to upload a photo.
there are 2 issues
i have set the media settings to Organize my uploads into month- and year-based folders
But when im uploading a photo for some reasons the upload goes in older folders and not Feb 2023.
if i disable this feature then the photos upload goes to the roor of the upload folder and again in the library shows error.
if i manually upload the photo via FTP in a specific folder also the last uploaded file shows as "no title"

Related

Photos not uploading in Wordpress media manager

I am trying to upload images into the media manager of a Wordpress website for my clients. No issues last time I touched this website, which was about a month ago.
So far, I have:
Tried uploading images that are already in the media manager (same size, file, etc)
checked all permissions in the FTP (all permissions are fine)
disabled each plugin, 1 by 1, until all were disabled to test if that was the issue (it wasn't)
uploaded an image directly into the FTP to get it to appear (it didn't)
reset the upload location for the media manager (thought that was the issue, but it wasn't. More on that below)
made a lot of grumpy noises
tried uploading different files (didn't work)
Reinstalled the latest update of WP
So far, here's what I know:
When I click "edit image" the image appears in the editor
In the FTP, when I upload the image, it appears in the appropriate folder (public_html/wp-content/uploads/2021/11)
when I access the image from the FTP, it is there in all dimensions as created by WP
The URL of http(s)://company.com/wp-content/uploads/2021/11/name.jpg brings me to a blank page
No errors are returning in console expect that there is a missing resource
It's even worse on Safari (as opposed to Chrome), where none of my images are appearing
So far, every answer I can find for this problem involves the permissions for the files, none of which seem to affect anything for me. The files upload automatically at a 644 permission level, though I can change them to a 744 and still get nothing.
SOS and thanks for any help!
Unfortunately, I don't have much of an answer as to why it works, but I do have a solution.
I backed up my WordPress site using a plugin, then restored the backup. My plan was just to do the backup, then restore an old backup, but just in case I tried restoring the backup I just created seconds before—and voila, it worked. I don't know why, but hey! I have a solution.
So make a backup, and then restore that backup.
Thank you to #bossman for helping out in the comments.

I can't upload image in wordpress

when i upload an image in wordpress media library this message appears
post-processing of the image failed likely because the server is busy or does not have enough resources. uploading a smaller image may help. suggested maximum size is 2500 pixels.
i have tried some methods to solve it like increase Maximum upload file size and change php version
I'm using hostGator as a web host .
use wp filter
add_filter( 'big_image_size_threshold', '__return_false' );
I faced the same issue and in my case it was related to nginx
413 Error response
Request Entity too large
and yes image was more than 2M by default in NGinx configuration
client_max_body_size 2M; -> client_max_body_size 64M;
should be set in server or location section of .conf file
Wordpress was running in docker compose and that was the root cause
If this error occurs on your Local by Flywheel desktop app I was able to fix it by changing the web server from nginx to Apache.
What fixed this error for me was updating an image related plugin called Images to WebP from version 1.9 to the latest which is 4.1 at the time of writing. And everything worked just fine afterwards. I found the solution here https://support.nova.bi/d/3-wordpress-error-while-uploading-images. I had tried everything including increasing PHP allocated memory, restarting my server, checking Wordpress permissions, modifying current theme functions.php file... but nothing worked. Only after I updated the plugin the upload worked again.
Hope this helps someone.
There are a few solutions to this issue. First, are you running PHP 7.3 and WordPress 5.3? You may try downgrading to PHP 7.2.
Next, you may try increasing your site’s memory limit.
If neither of these works you may attempt to work around it.
Go to your media library and select any picture. Preferably one that you managed to upload successfully. Click Edit and look at where the picture is located. keep this open or remember it.
Connect to your server via an FTP client and navigate to this folder where your images are stored. Upload your large photographs to this folder.
They won’t show up in your media library yet. You need to use a plugin called 'Add From Server'. Download that and install/activate it (by Dion Hulse).
Backup your WordPress installation (just in case).
Finally, hover over Media and then select the new option = Add From Server
Navigate to the folder where you uploaded your photos. Make sure you select just the photos you want to import into your Media Library (although you could delete the duplicates if you make a mistake).
After you click go, it’ll take some time, but don't cancel it or refresh the page. Just wait, and you’ll get a notification on the same screen when it's done. Along with a new list of imported files (including size variations if applicable).
Now your photos will be in your media library with ‘scaled’ at the end. You can now use these in your posts and they will work just fine.
NOTES
The files are imported to wherever you select them from. So it’s important that you put them in the same folder as the rest of your active pictures BEFORE you import them. Otherwise, they’ll show up in the media library, but won’t actually work on your website (took a while to figure this out).
I’d recommend importing 10-15 pictures at a time if they are large. Any more and you risk being signed out of your cPanel due to inactivity and it may break your installation (maybe, hence the backup).
Also, you may look through this wordpress.org thread as many solutions are discussed in the thread. https://wordpress.org/support/topic/unable-to-upload-images-67/page/5/
Let me know if this helps!

WordPress site isn't displaying images on the front end correctly

It is having problems displaying images. I think it could be a CSS, JS or caching issue? Project thumbnails and even normal images are not displaying. They appear in the media library folder fine, just not on the front end. The site is: https://www.thesaltypen.ie/ - Can supply WordPress login and FTP details if needed.
It seems as your site works correctly again?
If not you could check these things:
Check for errors in the console (there seems to be a problem with your theme (Failed to load resource), update it if necessary)
Use the inspector and check where you would expect images
Check the database entries, maybe there is a mistake with your connection
Check your hosting provider. Sometimes they restrict the upload and bandwidth

How to Revert Back Previous Custom Media Storage Link on WordPress via Filezilla

Actually the previous developer use custom media storage for the wordpress
storage media by that we not able to add new media because it display error at the time of upload directory not created check its parent have the write access .. that type of error it shows. So to avoid that error we change the custom media storage link to default one: which is now.. wp-content/uploads
After that site is running fine but when I saw some images are showing thumbnail problem then after sometime site is down and it showing only error message.
Only way I have where I make it work again is by using Filezilla.
I had also make a backup of it. Which I restore after by using only the wp-config file. By that site is running again but As I said if I visit another of it pages which are basically full of products images then again site will down.
I tried so many things by adding code lines in wp-config file to add that custom link again which previous developer was use but all in vain.
I had update the link by login to the wordpress media settings. But now it not shows any area to add custom link anywhere.
define('UPLOADS',".'media');
I have also try that line of code by creating a folder in Wordpress with 'Media' and add all the media files into this but is also not work for me.
And Originally my media files path is /public-html/wp-content/uploads
I just want to resolve it by previously customized adding link option and also want to enable the permission to add new media without disturbing the already publish images and other media on the running wordpress site.
did the previous developer use /year/month/ structure and you simply copied everything from /media to /uploads?
i would say, edit directly the database. first, checkout the links in the field GUID
SELECT * FROM wp_posts where post_type='attachment'
the links are in the GUID field. Now take a database search and replace tool and replace the wrong paths on the whole db:
eg:
https://example.com/media with https://example.com/wp-content/uploads
and escaped
https://example.com/media with https://example.com/wp-content/uploads
and just to make sure, also replace the url-encoded versions (get it with this tool)
this should fix all permalinks as well as the links in the post-contents.

Broken Images in Media Manager in Wordpress 4.7

We had an issue on our server which resulted in our entire 'wp-content' directory getting deleted.
We restored the themes, plugins and some of the images but we're now left with allot of broken images in the media library. We cannot re-upload and fix all of these broken images as the majority were generated from a feed which uses unique filenames etc..
Screenshot:
My question is simply, how do I quickly and easily remove all the broken images from the media library? They are obviously in the database and I just need to remove them.
If the files itself are still exist in the server with their original names in the time you uploaded them so you just need to generate again the thumbnails and there is a plugin called Regenerate Thumbnails that allow you to do it simply within a click.
If the files was restored without their original names, it will be actually impossible to recover them automatically because the system donesn't able to attach the uploaded files to the posts they was attached before.
You will have to delete all images that not linked to actual files and for now you will have to do it manullay because there is no plugin (at least not in WordPress repository) that offer this functionality. There is a plugin that called "Broken Images" that it's not updated for 2 years. I will not recommend to use it. I also searched for a plugin with some functionality but I didn't found and decided to develope it by myself. I'm going to release this plugin soon.

Resources