Can’t upload images in WordPress

This is awesome content as written by Fathi Arfaoui on the Trustiko website. Read more at https://trustiko.com/cannot-upload-images-in-wordpress-fix/ …Copyright (C) https://trustiko.com

One of the most common problems in WordPress (as any other platform) is to get error messages when trying to upload images. This is a big challenge for starters who can’t find a quick solution. So, I’ll show why you can’t upload images in WordPress, and how to solve these problems easily and directly from your cPanel without the need to use complicated ways.

This problem is similar to other issues such as the white screen of death, and it can be solved easily in a few steps, just follow them.

Fixing WordPress problems when uploading images

There are many cases, but, I’ll put all the similar problem in one case to make things easy to solve.

The uploaded file could not be moved to wp-content/uploads

This is the first error problem that appears on the WordPress image Uploader. I’ll show you how to fix it, but first, why this error?

The uploaded file could not be moved to wp-content/uploads

WordPress Uploader can work perfectly when your server allows to modify the ”upload” directory. But sometimes, web hosting companies can have issues with that, especially, those with the Softaculous auto installer. At the mean time, you can get this problem when migrating from servers and web hosting companies, your new host can find issues with the Uploader file permissions in WordPress.

Luckily, this issue can be solved in simple steps. All you have to do is to edit the ”upload” file permission to ”777”. It’s better to make it ”555”. But, it will never work with servers with Softaculous, or it works, but, with issues.

Of course, you should change the settings back to their original value, that’s important for security. So, let’s change it together.

If you don’t have cPanel, you have to apply the following tutorial, but after reading how to use FileZilla for your website. It’s a simple FTP software that will connect to your server, and let you manage all files.

Login to your cPanel account, then, locate ”File manager”. You will get a pop-up window to select the website that you want to use.

Can't upload images in wordpress

Then, you get the site files, find the ”wp-content” directory as the below screenshot.

wp content file

Next, open the ”Uploads” directory as the following example.

WordPress uploads file

The “uploads” directory is organized by years and months. So, you’ll find something like 2015 (years) as the parent folder. Forget everything about this file permission, even, if you find it ”777 ”it won’t work. That file needs permission for every file inside it.

We need to change the permission for months. Thus, your WordPress ”Uploader” get access to this file without the need to ask for permissions every time. So, open the year’s file “2015” for now, and you get the “months” inside.

WordPress ''Uploads''

Click on each month, and a new window at the top left corner of the page will open. Or simply, you will be able to edit the file on the same page if you use the ”File Manger”. You need to click on ”change permissions”.

Change file permissions in WordPress

Now, all you have to do is to set the permissions ”777” (read, write, execute) for every single month inside the uploaded images, then click ”change”.

Edit file permissions

Come back to WordPress, refresh the page, and you can upload your images naturally without problems. You can also change the permissions back to ”755”, but, it’s not guaranteed that the WordPress Uploader continues working.

Uploaded images disappeared in WordPress Posts

This is another common issue with WordPress Uploader, but, it’s easier to solve than the above problem. All you have to do is to define the file that will host your images. So, when you want to upload images, select ”Media File” File, and ”Full Size”. That’s for the first time when changing hosts or re-install WordPress.

Thus, WordPress Uploader can save your images in the right folder, and recognize them correctly.

Problems to upload photos in WordPress

Please make sure to delete your browser cache if you still get an error. It happens that the browser version or settings show the error, and even, switch your browser to verify the problem source.

Another case

This is a situation where you upload the image, it takes a long time to wait, and then, you get an error message that says:

“An error occurred in the upload. Please try again later”

In general, it’s a problem with the hosting provider that limit the PHP execution time to 30 seconds, or something similar. The solution is simply to close the pop-up window and refreshing the page by clicking “save draft”, or “update” button.

Then, you will find the uploaded image in your media library, and you just need to insert it in the post. The main idea here is that the image will be uploaded first, but the Uploader can’t see it.

You need to refresh the page as I said, you need to do that, for every image if your web hosting company wouldn’t change the PHP execution time limit.

If you want to upload images to WordPress and the problem persist, then, you should change your webs hosting provider, I recommend WP Engine for professionals. It’s a fully managed hosting for WordPress, and they’re the fastest web hosting without a doubt.

Your site will be loaded in less than one second, especially, when you have optimized images and a clean theme, without lots of banner ads anywhere.

Low-quality servers can’t help you in all cases and they will destroy your hard work. You have your own decision to continue with your actual hosting that cause problems, or, to upgrade to the best fully optimized hosting for speed and performance.

These are the common problems with WordPress Uploader. They happen when you change the server, and migrate your site to another hosting. If you have another issue and you want to share their solutions, or simply, want to ask how to solve them. You can explain all in your comment. So readers can learn from each other, and solve their problems when uploading images in WordPress websites.

Revisions

Tags: , ,

No comments yet.

Leave a Reply