The WordPress media library is the central hub for managing every image, video, audio file, and document on your website. Whether you are just getting started or looking to streamline an existing site, understanding how to use the WordPress media library will save you time, keep your site organised, and help you deliver a better experience to your visitors. This guide walks you through everything from basic uploads to advanced management techniques.
What Is the WordPress Media Library?
The WordPress media library is a built-in tool that stores and organises all the files you upload to your website. It acts as a central repository so you can reuse files across multiple posts and pages without uploading them repeatedly. Every image you add to a blog post, every PDF you link to from a landing page, and every video you embed is tracked inside the media library.
File Types Supported
WordPress supports a wide range of file types by default, including:
- Images: JPEG, PNG, GIF, WebP, SVG (with a plugin)
- Video: MP4, MOV, AVI, MPG
- Audio: MP3, WAV, OGG, M4A
- Documents: PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX
Grid View vs List View
The media library offers two display modes. Grid view shows thumbnail previews of your files, making it easy to browse images visually. List view displays files in a table with columns for file name, author, upload date, and which posts the file is attached to. You can switch between them using the icons in the top-left corner of the Media Library screen.
How to Upload Files to the WordPress Media Library
Uploading files is the most common task in the media library. WordPress gives you several ways to add new media to your site.
Uploading Directly from the Media Library
- Log in to your WordPress dashboard.
- In the left-hand menu, click Media and then Add New.
- Click the Select Files button or drag and drop files into the upload area.
- Wait for the upload progress bar to complete.
- Once uploaded, click the file to open its attachment details and add metadata.
Uploading While Editing a Post or Page
- Open the post or page editor in the WordPress block editor (Gutenberg).
- Click the + icon to add a new block and choose Image, Video, or File.
- Click Upload to add a new file, or click Media Library to select an existing one.
- The file is automatically saved to your media library for future use.
Uploading via WP-CLI
If you manage WordPress from the command line, WP-CLI makes bulk uploads fast and scriptable. Use the following command to import a local image into your media library:
wp media import /path/to/your/image.jpg --title="My Image Title" --alt="Descriptive alt text" --post_id=0
The --post_id=0 flag uploads the file as an unattached media item, making it available in the library without associating it with a specific post.
How to Organise Your WordPress Media Library
A cluttered media library slows down your workflow and makes it harder to find the right file. Good organisation practices pay dividends as your site grows.
Using the Built-in Filter Options
WordPress includes basic filtering tools at the top of the media library screen. You can filter files by:
- Media type — images, video, audio, documents, or unattached files
- Date — filter by the month and year the file was uploaded
- Search — use the search box to find files by name or title
Adding Folders with a Plugin
WordPress does not include native folder support for the media library. To add folders, install a plugin such as Real Media Library or FileBird. Once installed, these plugins add a folder panel to the left side of your media library, allowing you to drag and drop files into named folders such as Blog Images, Product Photos, or PDFs.
Organising Files with Meaningful Names
Before uploading, rename your files with descriptive, keyword-rich names using hyphens instead of spaces. For example, rename IMG_00123.jpg to red-running-shoes-side-view.jpg. This improves SEO and makes searching inside the library much easier.
How to Edit Images Inside the WordPress Media Library
WordPress includes a basic built-in image editor that lets you make simple adjustments without leaving the dashboard.
Accessing the Image Editor
- Go to Media > Library in your dashboard.
- Click on any image to open its attachment details panel.
- Click the Edit Image button below the thumbnail.
Available Editing Tools
The WordPress image editor provides the following tools:
- Crop — select an area of the image to keep and discard the rest
- Rotate — rotate the image 90 degrees clockwise or counter-clockwise
- Flip — flip horizontally or vertically
- Scale — resize the image by entering new width and height values
After editing, click Save to overwrite the original or use the restore function to revert to the original file at any time.
Adding Alt Text, Titles, and Captions
Every image in your media library should have descriptive metadata for accessibility and SEO. In the attachment details panel, fill in these fields:
- Alt Text — a short description read by screen readers and used by search engines
- Title — the internal name of the file within WordPress
- Caption — text displayed beneath the image on the front end
- Description — a longer description used on attachment pages
Advanced WordPress Media Library Tips and Tricks
Once you are comfortable with the basics, these advanced techniques will help you get even more out of the media library.
Changing the Maximum Upload File Size
If you receive a "file exceeds the maximum upload size" error, you need to increase PHP limits. Add the following lines to your wp-config.php file or ask your host to update your php.ini:
@ini_set( 'upload_max_filesize', '64M' );
@ini_set( 'post_max_size', '64M' );
@ini_set( 'memory_limit', '256M' );
Always test on a staging environment before changing server-level settings on a live site.
Regenerating Thumbnail Sizes
When you switch themes, image thumbnail sizes often change. Previously uploaded images are not automatically regenerated. Use the WP-CLI command below to regenerate all thumbnail sizes across your entire media library:
wp media regenerate --yes
This command processes every image in your library and creates new thumbnails matching your active theme's registered sizes.
Deleting Unused Media Files
Unused files waste server storage and can slow down backups. Use a plugin such as Media Cleaner to scan your library and identify files that are not attached to any post, page, or widget. Always back up your site before bulk-deleting media files.
Setting Up a Content Delivery Network (CDN)
As your media library grows, serving files from a CDN dramatically improves page load speeds. Plugins like Cloudflare or BunnyCDN integrate with WordPress to automatically serve your media files from edge servers closer to your visitors. Configure the CDN URL in the plugin settings and your existing media URLs will be rewritten automatically.
Common WordPress Media Library Problems and How to Fix Them
Even experienced WordPress users encounter issues with the media library. Here are the most frequent problems and their solutions.
Broken Image Thumbnails
If thumbnails appear broken or missing, the cause is usually incorrect file permissions on the wp-content/uploads folder. The correct permission setting is 755 for directories and 644 for files. You can fix this via FTP or by running:
find wp-content/uploads -type d -exec chmod 755 {} \;
find wp-content/uploads -type f -exec chmod 644 {} \;
HTTP Error When Uploading
A generic HTTP error during upload is often caused by a security plugin blocking the request, an exhausted PHP memory limit, or a corrupt .htaccess file. Try these steps in order:
- Temporarily deactivate your security plugin and retry the upload.
- Increase the PHP memory limit in
wp-config.phpas shown above. - Rename your
.htaccessfile to.htaccess_oldand regenerate it via Settings > Permalinks. - Contact your hosting provider if the issue persists.
Media Library Not Loading
If the media library popup fails to load inside the editor, the most common cause is a JavaScript conflict with a plugin or theme. Switch to the default Twenty Twenty-Four theme and deactivate all plugins, then reactivate them one by one to identify the conflict.
Frequently Asked Questions
How do I find images that are not attached to any post in the WordPress media library?
In your media library, switch to List view and use the filter dropdown at the top of the page. Select Unattached from the filter options to display only files that have not been inserted into any post or page. You can then decide whether to attach them or delete them to free up storage space.
Can I add folders to the WordPress media library without a plugin?
WordPress does not support folders in the media library by default. The only built-in organisation tools are date-based filtering and keyword search. To add true folder functionality, you need a plugin such as FileBird, Real Media Library, or WP Media Folder, all of which add a drag-and-drop folder interface to the existing media library screen.
How do I increase the file upload size limit in WordPress?
You can increase the upload size limit by editing your php.ini file, adding PHP ini overrides to wp-config.php, or creating a custom .htaccess rule. The specific method depends on your hosting environment. Managed hosting providers often include an upload size setting in their control panel. After making changes, verify the new limit by going to Media > Add New and checking the maximum upload size displayed on that page.
How do I bulk delete images from the WordPress media library?
Switch to List view in the media library. Use the checkbox at the top to select all visible files, or manually check individual files you want to remove. Then select Delete Permanently from the Bulk Actions dropdown and click Apply. Always back up your site before performing bulk deletions, as this action cannot be undone.
Managing your WordPress media library efficiently is an ongoing task, but the techniques covered in this guide give you a solid foundation for keeping your files organised, optimised, and easy to find. If you want to handle tasks like uploading files, regenerating thumbnails, or cleaning unused media without navigating through menus, WP AI Agent lets you manage your entire WordPress site — including the media library — through simple natural-language chat commands, making site management faster and more intuitive than ever.