This is a simple guide to fixing the problem where your images appear to upload to your WordPress site but don’t display properly in the media manager
Ever experienced that problem where you upload an image through the WordPress media-manager, but they don’t appear properly? It appears like it has uploaded but there is just a blank space where the image should display? This is normally a relatively easy problem to fix provided you have access to your web server or access to your site via FTP.
This is most commonly a problem to do with file permissions.
What are file permissions?
File permissions are web server system settings which apply to all web server files and determine who can access specified files and what they can do with those files.
In terms of ‘who’ or which ‘user’ can access the files, they are:
- The ‘owner’ of the file – The person who created the files.
- The ‘administrator’ – The person responsible for managing and updating files, as well as setting permission levels.
- The ‘Group’– referring to specific groups of users with unique settings specific to them.
- The ‘global’ group which is also sometimes referred to as anyone or public – Provides access to all users.
- The ‘individual’ user – allowing you to create a specific level of access at the individual user level.
Or sometimes you’ll only have these options:
- Owner
- Group
- Public or others
In terms of permissions, these are (basically):
- Read – this level of permission assigned to a file allows respective user to view and copy files but can’t make changes to the file or create new files.
- Write – this level of permission allows the user to edit, rename, and move files. In most cases, they can also create new files.
- Execute –this level of permission can run a specific program or type of program file.
You’ll also probably see the permissions most commonly referenced as numbers which refer to:
- 7 – read, write and execute (in other words, everything)
- 6 – read and write
- 5 – read and execute
- 4 – read only
- 3 – write and execute
- 2 – write only
- 1 – execute only
- 0 – none
Note the ‘permissions’ are also sometimes referred to as ‘properties’ or ‘CHMOD’
Why does this mean that my WordPress images don’t display?
When you upload a file to the web server (as you do with the WordPress Media Manager) it places the file in a folder and applies user ‘permissions’ to the file. When the media manager tries to display the file, if the permissions are not adequate for what it needs to do (in this instance, display the image in the dashboard), it won’t work and you’ll see an error (in this instance an empty grey box where the image should be.)
You also may be experiencing a problem where, when you try to upload an image, you get the error message along the lines of ‘unable to create directory wp-content/uploads… Is its parent directory writable by the server?’ – if this is the case it’s the same problem with the same fix.
How do I fix this problem?
To get the image to display properly, you’ll need to change the image file permissions for the appropriate users to ones that let the image display publicly on the server.
Before you attempt the fix, please remember that aome files are very dangerous if run on a webserver (such as executables or ‘.exe’ files) so make sure you know what you’re doing or get professional advice before you change the permissions for files like this. However, basic image files, such as JPGs or PNGs, are usually innocuous.
You can change the permissions for a single file, a whole folder (directory) and its contents, or a whole folder and its contents including all files, sub-directories, and the contents of sub directories
To fix the problem, change the required folder or image or images permissions to 744 (or 0744) – this is ‘owner can read, write and execute’, ‘group can read’ and ‘public can read’
You’ll need to access the website files using FTP or via your hosting control panel.
If accessing through FTP, navigate to your ‘uploads’ folder which is in the default ‘wp-content’ folder located in the public root directory of your WordPress installation.
For example, I only have images in my media manager so to change the file permissions for all the uploaded images, I access my web server using my FTP client, I navigate to the ‘wp-content’ folder, I then right-click on the ‘uploads’ folder, I then select the ‘properties / CHMOD’ option, I then change the permissions to ‘to should allow you to change the permissions of the folder to ‘744’ or ‘0744’ and click ‘apply’
Although individual FTP clients differ, this method normally allows to you change the permissions as required on any individual file or folder and contents.
To change the permissions using a file manager, I log into my hosting account, navigate to my file manager, navigate to the required folder or file and then use the file manager tools to change the permissions as above. I can’t give individual instructions here as there are too many individual hosting accounts with different file managers.
if, when trying to upload a new image, you’re getting the error message ‘unable to create directory wp-content/uploads… Is its parent directory writable by the server?’, this means that WordPress cannot make a new folder on the server to upload the new image to. In order to create a new folder (aka directory), the containing folder must be writable by the server. In this instance it’s normally the ‘uploads’ folder which is inside the ‘wp-content’ folder. Change the permissions for the ‘uploads’ folder to ‘744’ or ‘0744’ and try again.
If you’re unable to change the permissions for images or folders using this method, it may be that you don’t have sufficient permissions to make these changes. If this is the case, talk to your hosting provider or give us a call if you need a hand