Port to the world of technology

How to Fix the Image Upload Issue in WordPress

0

The image upload issue in WordPress is one of the worst-case which has no exact reason and exact solution. There are different reasons that cause this image upload issue and also it has different solutions. Actually it’s impossible to predict the time it happens and sometime it may occur randomly.

However, there are a number of ways to fix this issue. From this article, we hope to discuss 7 out of these ways.

Asking Your Host for Help With the Image Upload Issue

If you are not familiar with WordPress it means you have not more experience with WordPress, this is the best way to fix this issue by asking your host. Most of the time there is no need to ask by host since they may not be able to do anything.  But it is good to ask in case they are able to correct the issue.

If your problem is not settled yet with the help of the host, then continue.

Does the Image Upload Issue Occur for All the Images or One Image?

It is very important to check whether the problem occurs for one image or all the images you upload(including the ones already in your media library) to solve the error.

There are two procedures with each above category.

If the image upload issue occurs with all the image you have:

  1. Change file permissions.
  2. Deactivate plugins, especially plugins that optimize images.
  3. Increase your site’s PHP and WordPress memory limits.
  4. Remove the file path on the Media Settings page.
  5. Check to see if the PHP version you’re using is causing issues.

If the image upload issue occurs with one image you have:

  1. Rename the image.
  2. Decrease the image’s resolutions.

Solution 01 – Change File Permissions to Fix the Image Upload Issue

For this solution, you will need to use an FTP client or access your host’s control panel. When your host makes updates on your server, they may affect your site’s file permissions causing the image upload error to appear.

If you plan to use your host’s control panel or a different FTP client, these instructions refer to FileZilla, a popular FTP client, so follow along carefully.

First, you should access your site’s files, and open your site’s root directory, typically called public_html. Next, open the wp-content folder. This is where the Uploads folder is located. There is an additional folder in the  Uploads folder contains that stores your media files when you upload them to your site.

Uploads File Permissions

Right-click the upload folder, and select File Permissions as above image. Check that a numeric value that’s already there.

A new window will be displayed, named “Change File Attributes “. Change these settings there.

    • Numeric Value: 744
    • Recurse into Subdirectories:  Tick.
    • Select the Apply to Directories Only radio button.

Change File Permissions for Image Upload Issue

Press OK when you have finished. Sometimes it may not work. In that case, repeat the steps and change the Numeric value 744 to 755. If it didn’t work, Right-click the Uploads folder and select File Permissions. Next, you should enter the original number value that was there when you started, and continue to the next solution.

 

Solution 02 – Deactivate All of Your Plugins

Here the trick is; if you use a plugin to optimize your images, try deactivating it before uploading images to see if that fixes the images upload issue for you. Try deactivating all of your plugins if not. If your site uses a lot of plugins and has grown quite a bit, then there is a high chance of reaching its memory limits. Hence it may prevent you from uploading media files.

After deactivating your plugins, check whether if it is work or not properly. If it did not work for you continue to the 4th solution. If deactivating your current one fixed the issue for you, then find a new image optimization plugin, or you can contact the developer directly to see if they have a solution.

Continue to the next solution if deactivating all of the plugins worked for you.

Solution 03 –  Increase Your Site’s Memory Limit

As stated in the previous solution it’s possible your site has grown to the point where you’re reaching its WordPress and PHP memory limits, . This is absolutely true if your site runs on a shared hosting server as shared hosts often put strict limits on the amount of memory its users are allowed to use.

If you’re on a shared hosting server, you may have a tough time and it is difficult for increasing your site’s memory limit yourself and it’s better ask your host to do so for you. We’ve already created an entire post explaining how to increase your memory limit in WordPress. 

Important: It requires accessing your site through an FTP server, editing your files and adding code to them. Hence if you’re still new to WordPress and building websites, be prepared to do all of that.

Solution 04 – Remove the file Path from the Media Settings Page

This solution isn’t a popular one to fix the image upload issue, but it has worked for some. For that;

Sign in to the admin area of your WordPress site ⇒ open the Settings menu ⇒ select Media

Then a textbox will be displayed with a file path where the files should be uploaded to. Now, delete the text in the file path textbox, and after you’ve done, click Save Changes.

Open the Media settings page and check that. If you only see dimensions for image and a setting that says your files should be organized into month/year folders, you won’t find any use with this solution.

Solution 05 – Change the PHP Version You’re Using

WordPress is developed with PHP, a server-side scripting language. PHP has its own updates similar to how WordPress, your plugins, and the theme need to be updated. WordPress requires PHP version 5.2.4+ at the bare minimum, thoughts it recommends PHP 5.6 or later, as of May 2016.

Sometimes users have been able to fix the image upload issue by upgrading to the latest version of PHP or downgrading to the previous version of it. You can achieve this task in cPanel by selecting PHP Config under the Programming, Software/Services, or Advanced sections.

If you’re new to WordPress, enlist the help of your host to make sure it’s pay for you to change your PHP version as the change could potentially break your site. Backup your site at the very least, especially your .htaccess file.

The only thing you have to do is select a different PHP version in PHP Config, and save your changes.

Solution 06 – Fix the Image Upload Issue by Renaming Your File

If you’re experiencing this issue with one image, your solution may be easier than the previous solution. Rename the file on your computer before you upload it to WordPress to start out with. Check twice your file names and make sure there are no apostrophes in your file names as this tends to cause this error to appear.

Your file name should be written in all lower case letters. If it still doesn’t work, try changing the file type, such as turning a .jpg file into a .png file and vice versa.

Solution 07 – Optimize the Image before Uploading It to Your Site

It may be a reason for a variety of different issues if your uploading images are larger than you. It can also affect your site’s memory limit quicker than it should have.

 A good solution of thumb to follow is to never upload a regular blog post image that’s wider than your content width unless it’s featured or header image. A simple way to figure out your content width is to open any blog post on your site, right-click anywhere within it and select Inspect element.

Content Width

Here you should find a class called “content”.  For that click on each arrow to open more of the code until you find that class. Hold on over that class once you find it. It will highlight the content are of your post. Once it does, it’ll display the width of your content are in a small, yellowish pop-up box.

Content Width

 Try to maintain your images below this width. You can also pick a maximum file size to optimize your images even more. The maximum file size of most sites is to stick to a 100 KB rule and optimize their images based on that number prior to uploading them to WordPress.

If you need to check that if this is the issue, resize the image in Photoshop or GIMP, and re-upload it to your site.

 

 


Final Thoughts

This is a mysterious issue to have on your site, and many WordPress users state they were unable to fix their own issues even after following all of these steps. If you can’t figure this one out and you still have yet to contact your host, do as soon as possible. They may have a quick and simple solution for you.

 If you are new to WordPress or not an experienced developer or WordPress user, you may need to go as far as hiring a developer to take a look at your site for you as there may be an issue with your code that’s uncommon and specific to your site.

Managing your own WordPress site is hard work, and handle these types of issues is even harder. That’s why so many site owners and developers turn on managed WordPress hosts as they do a  much better job of managing all of this stuff for you. If you’re on a shared hosting server or are unhappy with your current host, check out wdbegginer’s guide on how to choose the best hosting provider for WordPress.

Leave A Reply