Wordpress media uploader not uploading properly - wordpress

I am uploading media via the Wordpress media uploader. It says it uploads the file fine (and if I check inside my uploads folder, it is in fact there).
But the image is broken on the frontend, and if I go to the media uploader, it shows a broken image.
Now the strange thing, is if I click 'edit image' in the media uploader, it shows me the image...
the link to the image is also correct except when I use that link to view the image I am taken to a 404 page.
I would like to add that I de-activated all the plugins I am using and there is no change. As well, I've given the uploads folder permissions of 777. No change.
The uploader works fine on my remote server, but this happens when I use the site locally (using MAMP).
I just want to know what the problem is and if it is something that will occur when I set the site live on another server...What is going on?
Any help is appreciated!

Check if you have any .htaccess or php.ini with restrictions for all SPECIFIC related folders ( Content, Uploads , Year/Month folders )
One of them is bound to exists .
Otherwise - it is a hosting problem / configuration .

Related

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

Cannot add or edit current pages in Wordpress

I keep getting this page whenever I try to edit or add a new page. I cannot do anything to edit my Wordpress pages. My website currently uses WordPress 5.3.2 and it also uses the new Avada theme 6.2. It has been like this all day. What I see when I click to edit through fusion builder or the regular wordpress editor
I can assume that there is an issue with CSS files delivery, it looks like the styles files (css files) are not being opened on your website page.
Possible reasons that might cause this are:
404 error: means all .css files are being called from the wrong URL which might happen if you changed your website URL recently.
You might have moved your website to SSL which changes the http:// to https://.
Possible solutions:
Try to clean your website cache.
Try to access your website using the private session within your browser.
Can you please share your website url?
You can try looking at the browser console to see what error is occurring.
In the recent version of Wordpress this is causing performance errors at its core:
Try adding the line below to your wp.config file below that IF:
/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
define('CONCATENATE_SCRIPTS', false);
I had an error that did not load JQuery, when clicking on any button to upload files not working. So after I added the last line it worked.

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.

Folder permissions for custom Wordpress uploads folder

I have created a new Wordpress website on my server and done everything as I normally would (nothing fancy or custom, just upload theme, a couple of plugins etc.) except I wanted a custom file path to my media folder.
I have created the folder '/public_html/i', updated my .htaccess file, updated the Setting > Media section in Wordpress with the file path and all is working fine.
My issue is that I do not want the uploads folder to be visible by navigating to the URL (www.site.com/i/).
If I change the folder permissions to execute only for group / world (711) the images become unavailable / unviewable and although I can still upload they show as broken images.
If I set to execute and read (755) the images and uploads work fine but the folder can be viewed by typing in the URL.
What are the correct permissions I should be using for a custom uploads folder to make images on the site viewable but the containing folder itself not?
Note that this is a site that will regularly have new images uploaded to it, so I would also need to be able to upload without having to change the permissions each time, which is one solution I have found online.
Thanks in advance for any help.
Add the following to your .htaccess file with the WordPress .htaccess instructions:
Options -Indexes

Images not working in wordpress installed in a subdomain/subdirectory

I installed a copy of another wordpress installation of a client in a subdomain. All seems to work fine but images don't. I'm using videos as background and they are working perfect. If I take a look inside the media menu the images are not visible (you can only see an X for every image), but if you manually take the link of every image all the links works fine and images are accesible.
I suspect that issue is related with any of the functions that process images. Maybe some kind of error related with the subdomain which obviously have a dot in the domain name.
¿Any idea?
Thanks in advance!
I assume that you uploaded the images of the client's WordPress installation via FTP.
As far as I know WordPress Media Library cannot “see” images that are not uploaded through the Media Library uploader. The Media Library uploader (aside from uploading your media) creates necessary references within WordPress which you don't have when uploading media via ftp.
This is a common WordPress flaw. There are plugins which might solve your problem by creating the necessary references after such a ftp upload, e.g. Add From Server.

Resources