Getting Started with Images in WordPress

Posted May 1, 2013

One of the many tasks of managing a website is adding images to your content. Since most people won't like the idea of using an FTP client to manage multiple sizes of every image, you'll need to get familiar with the WordPress Media Library. This article will focus on how it handles images, but don't forget that it can also be used to store documents, audio, and video. Most of this tutorial may be common sense, but hopefully it shines some light on pieces that can be a little confusing. WordPress 3.5 made some major improvements to the Media Library, so if you aren't on the latest version it's worth an upgrade!

Drag and DropAdding images to your posts isn't hard, just click "Add Media" on the editor screen then you'll be prompted to either select a file to upload or drag and drop your files. I personally prefer the ease of dragging and dropping since I usually have the image file ready.

Once you've uploaded the image you'll have the option to give it a title, caption, alt text, and and description. You may have to scroll down to see it, but then it gives you options for how you'd like to display the image in your post. You can choose how to align the image (if alignment isn't working check that your theme's CSS has all the WordPress classes), if you'd like to link it to something (directly to the media file, to a page containing the file, or to a custom link), and the size you'd like to display the image.

Media details

Depending on the size of the image you've uploaded, you'll notice the options for thumbnail, medium, large, or full. Full is exactly what it sounds like. The other sizes can be customized in by going to Settings > Media from the WordPress dashboard. WordPress automatically generates a file for each size (as long as the dimensions are smaller than the original - it doesn't upscale) when you upload an image. Your theme or certain plugins may also tell WordPress to generate additional sizes for things like featured images or retina images. Even though every image in your media library will have multiple files because of the different sizes, most hosting plans offer enough storage that you probably won't run into any problems. Some hosts do restrict the number of files in a directory, so be sure that in your media settings you have "Organize my uploads into month- and year-based folders" enabled. If your host is warning you about folders with too many files, there are a few plugins that allow more detailed customization for organizing your media into subfolders.

Once you have everything set how you'd like, you can click "Insert into post" and WordPress will add the necessary HTML into your post.

You might have also noticed that there's an option to create a gallery. This might be something you'll need occasionally, but I'd recommend testing out some gallery plugins if it's something you plan on using on a regular basis.

WordPress also has the ability to set a featured image for a post which can then be used around the site to represent that post. You'll see a "Featured Image" section on the post edit page if your theme supports this feature.

Soon I'll go into some more advanced ways to take advantage of the Media Library, so keep an eye out if you're a veteran user looking to get started with your own themes or plugins.