How To Edit Images In The WordPress Media Library
This tutorial covers:
- How to access the ‘Edit Media’ screen in the WordPress Media Library.
- How to edit images in the WordPress Media Library
- Editing image file attributes
- Making images accessible to users and search engines – alt text, captions, titles, and image descriptions.
- How to perform additional image edits, including rotating, cropping, and resizing.
- How to access more ‘Edit Media’ screen options.
See the tutorials below if you need help with other aspects of using images, like:
- Preparing images for use on your site
- Sourcing free or royalty-free images for your content
- Using the WordPress Media Library
- Adding and formatting images in WordPress
- Adding an image gallery to your content
- Using featured images in your posts and pages
The screenshots in this tutorial were created using the WordPress Classic Editor.
If you use the WordPress Block Editor, then refer to these tutorials on using image-related blocks to access the WordPress Media Library:
How To Access The Edit Media Screen In The WordPress Media Library
You can reach the Edit Media screen in one of the following ways:
- By clicking the Edit link when adding new media files to your site,
- From the Media Library by clicking the Edit link associated with the media item.
Accessing The Edit Media Screen When Adding New Media Files
To edit an image immediately after uploading it to your Media Library, click on the Edit link next to the image.
Accessing The Edit Media Screen From The Media Library
You can also edit an image by hovering over its details in the Media Library screen and clicking on the Edit link in the inline menu.
Either of these methods will bring up the Edit Media screen on your browser.
How To Edit Images In The WordPress Media Library
The Edit Media screen lets you manage all the information associated with your media file.
Editing image file attributes
In the Edit Media screen, you can perform the following editing functions:
- Image Title – Change the title of your image.
- Permalink – Edit the Permalink of your media file’s attachment page. Note: You can only edit the image’s post slug (Permalink) if the media file is attached to a post or page. If the media file is unattached to a post or page, this field is not editable. If you need help understanding how to attach and detach images from posts and pages, see this tutorial.
- Edit Image button – Click the button to access additional image editing functions. (see next section below)
- Alternative Text – Alternative text (alt tags) improve accessibility and search engine indexing.
- Caption – Captions display below your image.
- Description – Image descriptions display on the media file’s attachment page.
Let’s expand on the use and purpose of the fields shown above.
The screenshot below shows examples of using the Edit Media fields to add information to an uploaded image.
Making images accessible to users and search engines
Images on their own may not provide enough context for general users or readers with visual impairments to understand what the image is all about or help search engines index your image correctly.
WordPress lets you add the following kinds of information to images in the Media Library:
Every media file in the Media Library (e.g. images, videos, audios, etc.) has both a filename and a file name.
These are not the same thing.
With images, for example, the image filename is the name you give to your image when creating, saving, and uploading the file to your Media Library, server, or external storage location.
The image file name, on the other hand, is the title the Media Library assigns to the uploaded image.
As an example, here’s the image we have uploaded for this tutorial. Its filename is
When the image is uploaded to the Media Library, WordPress automatically assigns a default title to the image (i.e. a file name) based on the image’s filename.
In the screenshot below, for example, our image has the same file name (image title) and filename.
WordPress, however, lets you change the title of your uploaded media files (images, videos, audios, etc.).
Note: Image titles do not display to users or search engines (i.e. it has no SEO benefit) but it can help make identifying and searching for images and other media files in the Media Library easier.
If the image is attached to a post or page, you can also change the image slug (permalink).
Although this may arguably confer slight SEO benefits, it’s better to use the keywords you want to rank for in the image filename if you want to optimize your image for search engines.
Now, the same image has an easy-to-identify “image title” (note: the image filename remains the same and can’t be changed).
As mentioned earlier, the ability to edit your media file titles can help to make it easier to find images (and videos, audios, documents, etc.) in your Media Library.
Alternative text (also referred to as ‘alt text’ or ‘alt tag’) adds a text description of your image in case the image doesn’t display or render on your reader’s web browser.
It also improves your content’s accessibility (e.g. it can be read aloud by screen readers and some web browsers to help visually impaired users).
Different types of images have different alt tag requirements. To learn how to use alt tags effectively with images for accessibility and SEO, see the resources below:
The caption displays below the image. Captions describe images to help users relate to the surrounding text.
According to Wikipedia,
Most captions draw attention to something in the image that is not obvious, such as its relevance to the text.
You can also use basic HTML formatting in your caption text.
You can add HTML tags to caption text while editing your image…
Or use the Classic content editor’s formatting buttons after inserting the image into your content. Just select the text and click on the formatting buttons.
Descriptions allow you to provide a longer explanation of images than alternate text and can be useful in some situations.
For a comprehensive resource on using image descriptions for accessibility purposes, see this guide.
In WordPress, text added to the Description field displays in your media file’s attachment page and other areas specified in your theme and/or certain plugins.
Image Attachment Page
Every media file uploaded to the WordPress Media Library gets its own unique page, called an attachment page. This includes images, videos, audio files, etc.
You can access an image’s attachment page:
- From the Media Library (note: how you get there depends on whether the Media Library screen is set to Grid or List view)
- When editing images inserted into posts or pages.
Accessing The Image Attachment Page From The Media Library
If your Media Library is set to display media files in ‘Grid’ view, click on an image thumbnail…
This brings up the Attachment details screen.
Click on the View Attachment Page link to visit the image’s attachment page.
If your Media Library is set to display media files in ‘List’ view, hover over your image entry and click on the inline menu’s View link…
Click on the ‘View Attachment Page’ link in the Admin toolbar…
The attachment page will load in your browser.
You can manage any comments added to media files in the Comments section.
Also, see the More Edit Media Options section further below for additional options relating to using comments in your media files.
Accessing The Image Attachment Page When Editing Images In Posts And Pages
To view an image’s attachment page when editing images in posts and pages:
- Select Link To: Attachment Page in the ‘Display Settings’ section of the Image details screen,
- Copy the web address from the URL field below the ‘Link To’ section to your clipboard.
- Paste this link into a new web browser tab or window to load the attachment page.
Additional Image Information
Another important section of the Edit Media screen is the Save meta box.
The Save meta box displays information about your media, such as the file upload date, file URL, filename, file type, and image dimensions.
This section also allows you to delete your image by clicking on Delete Permanently or Update any changes you have made to your image.
Editing Image Files
In addition to editing image file attributes such as the title, caption, description, etc., you can make further edits to the image file itself.
To edit an image file in the Edit Media screen, click on the Edit Image button below the image.
This will load additional editing functions in the Edit Media screen.
Above the image, you will see a row of image editing buttons.
Note: Any edits you make to your image in this section are non-destructive — you can restore the image to its original (uploaded) specifications at any time.
Image Editing Controls
Here are the various controls available to you in Edit Image mode:
- Crop Image Tool: Click on the Crop button to crop your image.
- Rotate Left: Click to rotate your image counterclockwise.
- Rotate Right: Click to rotate your image clockwise.
- Flip Vertical: Click to flip your image vertically.
- Flip Horizontal: Click to flip your image horizontally.
- Undo Edit: Click to undo your last edit.
- Redo Edit: Click to restore your last edit.
Note: Clicking the Undo/Redo buttons successively to step you through previous edits.
Let’s go through some of the functions listed above.
When cropping images, you can specify a selection box without restricting your crop area or use a fixed aspect ratio.
Cropping Images Without Restricting Crop Sizing
To crop your image without restricting the selection area:
- Click on the image and drag your mouse while holding the left mouse button down to draw a selection box around the area you want to crop.
- After drawing the crop region around the image, use the selection box handles to fine-tune the shape of your crop region.
- When you are happy with your selection, click on the Crop button to crop your image.
Here are the steps described above…
Cropping Images Using Fixed Aspect Ratio
You can also use a fixed aspect ratio to make precise adjustments when cropping images.
Click on the question mark icon next to the Image Crop section for an explanation of the tool’s features:
- Aspect Ratio: Specify the crop selection aspect ratio then hold down the Shift key while dragging to lock it. You can use values like 1:1 (square), 4:3, 16:9, etc. Note: If you have already drawn a crop image selection, specify the aspect ratio to automatically adjust it over the image.
- Selection: Once you have made your selection, you can adjust it by entering the size in pixels. Note: these values are scaled to approximately match the original image dimensions. The minimum selection size equals the thumbnail size as set in your WordPress Media Settings.
Cropping Keyboard Shortcuts
You can also use the keyboard shortcuts below to fine-tune your crop selection and the size of the crop frame.
Note: The arrow key can be any of four arrow keys: up arrow, down arrow, left arrow, or right arrow:
- Arrow: move by 10px
- Shift + arrow: move by 1px
- Ctrl + arrow: resize by 10px
- Ctrl + Shift + arrow: resize by 1px
- Shift + drag: lock aspect ratio
To scale an image:
- Use the Scale Image section of the ‘Edit Media’ screen (if accessing the image via the Media Library) or the ‘Edit image’ screen (if editing an image inside a post or page).
- Change one of the input fields (width or height),
- Click on the Scale button.
For additional information about scaling images, click on the question mark next to the Scale Image section.
After clicking the Scale button, your image will be scaled to the new specified dimensions.
- Original images are scaled proportionally.
- Images can only be scaled down, not up. This prevents creating ‘fuzzy’ (i.e. pixelated) images.
- For best results, the scaling should be done before performing any other operations on it like crop, rotate, etc.
- The original dimensions (e.g. 1920×1215) are displayed above the ‘New dimensions’ input fields.
After scaling an image, a Restore original image section will appear under the Scale Image panel.
Click the Restore image button to discard changes and restore your image to its original dimensions.
Note: any previously edited copies of the image will not be deleted.
Rotate And Flip Images
In addition to cropping and scaling images, you can also rotate and flip images by clicking on the buttons.
After editing your image, click Save to update your image settings and return to the ‘Edit Media’ screen or click Cancel if you don’t want to apply any of the changes you have made.
More Edit Media Options
Some additional options of the ‘Edit Media’ screen are not visible by default.
To enable these, click on the Screen Options tab at the top right-hand of the Edit Media screen.
This will reveal a few additional options:
- Discussion: Controls the ability to leave comments and/or trackbacks and pingbacks on the media attachment page. Tick the checkbox to enable an option, uncheck to disable.
- Comments: Displays current comments on the media attachment page. You can add a new comment or show existing comments.
- Slug: This allows you to edit the slug for attached media items.
- Author: Allows you to change the Author for attached media items by selecting a new author from the drop-down menu.
To automatically enable and make these options visible on your Edit Media screen, check the box next to the item in the Screen elements section. (Note: unchecking the box hides the item).
When enabled, the selected options will display below your main edit area.
Remember to click the Update button to save your changes.
Congratulations! Now you know how to edit images in the WordPress Media Library.