Adding images and other media files such as videos, documents or PDFs is extremely easy within WordPress. All your images and files are stored in the Media Library. Once they’re uploaded into the Media Library, it’s a very simple matter to insert them into your Page or Post content. In the case of files such as Word Documents or PDFs, if necessary, it’s a simple process to create links to those files so that people can then download them.
Inserting an image
Using the WordPress media manager, it’s extremely simple to insert, align and link your individual images and image galleries.
To insert an image into your Page/Post, click the Add Media button () and then simply drag your image(s) from wherever they are on your computer, into the browser window. Your file(s) will be automatically uploaded.
Alternatively, click the Select Files button and then select the file(s) that you’d like to upload, using the dialog window that is displayed.
It’s also possible to simply drag your image straight into the Visual Editor, rather than clicking the Add Media button.
No matter whether you’ve clicked the Add Media button or simply dragged and dropped your image into the Visual Editor, once your image is uploaded, your Media Library is displayed, which contains all your previously uploaded images. The image(s) that you’ve just uploaded will be automatically ‘selected’ for easy insertion into your Page or Post. Selected images are shown with a ‘tick’ icon in the top right corner of the image.
After uploading your image(s), you can then select other previously uploaded images by holding down the Ctrl key (Cmd key on Macs) and simply clicking on them. To deselect an image, click the ‘tick’ in the top right corner of the image.
At the bottom of the window you will see a count of the number of images currently selected.
There are several options within this Insert Media window to help make it easier to add images into your Page or Post.
By default, all previously uploaded images are shown, starting with the most recent uploads. If you’d like to narrow this list down, at the top of the window is a dropdown list that allows you to filter your displayed images by All media items, items Uploaded to this post/page, or Images, Audio files, Video files or Unattached files. You can also filter your media files by selecting a date, or alternatively, there is also a Search field that allows you to search for specific images.
The properties of the currently highlighted image (i.e. The image with the blue border) will be shown on the right-hand side of the Insert Mediawindow. These properties include the filename, the date the file was uploaded and the image size. It’s at this point you can also change the image Title, Caption, Alt Text and Description for each image, as well as the Alignment, Link and the Size at which the image is inserted.
- Title – is displayed as a tooltip when the mouse cursor hovers over the image in the browser
- Caption – is displayed underneath the image as a short description. How this displays will be dependent on the WordPress theme in use at the time. You can also include basic HTML in your captions
- Alt Text – is displayed when the browser can’t render the image. It’s also used by screen readers for visually impaired users so it’s important to fill out this field with a description of the image. To a small degree, it also plays a part in your website Search Engine Optimisation (SEO). Since search engines can’t ‘read’ images they rely on the Alt Text
- Description – is usually displayed on the attachment page for the media, however this is entirely up to the theme that is currently in use
Edit or Delete and Image
There are various options available for adjusting the layout of inserted images.
After clicking on an image that has already been inserted into your Page or Post, a small toolbar will appear over the image. By selecting one of the alignment buttons () you can change the alignment of the inserted image. Clicking the Edit button () allows you to edit the image properties. Clicking the Remove button () will remove the image from your content. It will only remove the image from your Page or Post, it will not delete the image from your Media Library.
When you click on an image in your Page or Post, as well as the alignment, edit and delete icons mentioned above, the image also displays ‘resizing handles’. These are the small squares you see around the edge of the image. To resize your image, simply click and drag one of the corner resize handles.
As with any image editing software though, if you try to enlarge a small image, it will tend to get quite pixelated. It’s always best to insert a large image and then resize down.
After clicking the Edit button () the following pop-up window will appear.
The Image Details pop-up window allows you to edit the various image and link properties:
- Caption – Displayed underneath the image as a short description. How this displays will be dependent on the WordPress theme in use at the time. You can also include basic HTML in your captions
- Alternative Text – Displayed when the browser can’t render the image. It’s also used by screen readers for visually impaired users so it’s important to fill out this field with a description of the image. To a small degree, it also plays a part in your website Search Engine Optimisation (SEO). Since search engines can’t ‘read’ images they rely on the Alt Text
- Align – Allows you to select how you would like the image aligned. They can be either Left, Centered or Right aligned. Setting alignment to None will remove the other alignment settings. How this affects your image within your content will depend on the current theme in use
- Size – Select a specific size from the dropdown list or select ‘Custom Size’ and then enter the Width and Height (in pixels) in the input fields that appear
- Link To – Select where you would like to link your image to from the dropdown list. You have the choice of linking to the image attachment page by selecting Attachment Page, or you can link to the full size image by selecting Media File. You can also link to any URL by selecting Custom URL. When you do this, a new field will appear that allows you to enter in the custom URL. You can also choose not to link to anything by selecting None
- Image Title Attribute – Displayed as a tooltip when the mouse cursor hovers over the image in the browser
- Image CSS Class – By default, WordPress will assign several CSS Classes to your image. If, for some reason, there’s other CSS Classes that you’d like to assign to your image then you can add them into this input field
- Link Rel – describes the relationship from the current document to the specified link. More information on the rel HTML attribute can be found on Wikipedia
- Link CSS Class – If there is a specific CSS Class that needs to be set on the HTML link then you can add it into this input field
Clicking the Edit Original button allows you to perform some simple manipulation with your uploaded image. You’re able to rotate and flip your image as well as scale and crop it to different sizes.
If you’d like to replace the image entirely, click the Replace button and you’ll be shown your Media Library where you can select a new image.
Once you have updated the image properties, click the Update button to save your changes. Alternatively, click the small ‘x’ in the top-right of the pop-up window to close the pop-up without saving any changes.
For each image, you can select how you would like the image aligned, either Left, Center or Right aligned, using the Alignment dropdown list. You can also select None for no alignment which will mean the image will display using the default alignment setting for your Theme.
You can also change what your inserted image(s) will link to using the Link To dropdown list. You have the choice of linking to the image’s attachment page by selecting Attachment Page, or you can link to the full size image by selecting Media File. You can also link to any URL by selecting Custom URL. When you do this, a new field will appear that allows you to enter in the custom URL. You can also choose not to link to anything by selecting None.
When your image(s) are uploaded, WordPress will also create several copies of your file at various sizes. You can choose which one you’d like to insert into your Page or Post using the Size dropdown list. To insert the image at the exact size you uploaded, simply select Full Size. Next to each size listed in this dropdown will be the actual dimensions of the image, in pixels (e.g. 300 x 225).
Once you’ve selected all your images, click the Insert into post button to insert the selected image(s) into your Post at the current cursor position (when editing a Page, this button will say Insert into page).
If you’d like to change the order of your images, click the Edit Selection link at the bottom of the Insert Media window. The window will change so that only the selected images are shown. Alternatively, clicking the Clear link will deselect all images.
After clicking the Edit Selection link at the bottom of the Insert Media window, all the currently selected images are shown. You can change the order in which the images will appear in your Page or Post by clicking and dragging each image to reorder them. You can also update the image Title, Caption, Alt Text and Description for each image. To remove one of your selected images, click the small ‘-’ that appears in the top right corner of the image when you hover your cursor over the tick.
Clicking the Return to library button will take you back to the previous screen that allows you to select or deselect your images.
When you’re editing your Post/Page, if you wish to insert an image that you uploaded earlier (as opposed to uploading a new image), click the Add Media button again (). Once the pop-up window displays, click the Media Library tab at the top of the pop-up window rather than dragging a new file into the upload window. All your previously uploaded images will be displayed, with the most recent ones shown first.
Select the image(s) that you’d like to insert into your Page or Post and then simply click the Insert into post button (or if you’re editing a Page, this button will say Insert into page). As mentioned earlier, you can also click the Edit Selection link at the bottom of the window if you’d like to change the order the images are inserted.
Setting a featured image
Some themes allow you to specify a Featured Image for your Page and Post. A Featured Image, often called a Post/Page Thumbnail, is usually some sort of image that is representative for that particular Page or Post. How these images are displayed is dependent entirely on the Theme that is currently in use.
If your Theme allows you to set a Featured Image, the following Featured Image panel will be displayed when you’re editing your Page or Post. If Featured Images can’t be set then this panel won’t be displayed.
Setting your featured image is very similar to adding an image into your Page or Post. After clicking the Set featured image link a pop-up window will display that looks similar to the one that displays when you add an image to your Page/Post. You can upload a new image to use as your Featured Image or you can simply choose from one of your previously uploaded images.
By default, you’ll be shown a list of the previously uploaded images. If you’d like to upload a new image, click on the Upload Files link at the top of the pop-up window. After clicking the image you’d like to use as your featured image you can then update the Title, Caption, Alt Text and Description. To set the image as your Featured Image, click the Set featured image button. Your chosen image will then appear in the Featured Image panel.