Skip to content
BeoHosting
BeoHosting
WordPress

Guide to the WordPress Media Library

BeoHosting Team··9 min read read
Guide to the WordPress Media Library

What is the WordPress Media Library

The WordPress Media Library is a centralized system for managing all media files on your site, including images, videos, audio files, PDF documents, and other file types. It's accessed via Media, Library in the admin menu or directly when adding content to posts and pages. The Media Library stores files in the wp-content/uploads directory organized by year and month, and file metadata is stored in the database in the wp_posts table with attachment type.

Understanding the Media Library is important for every WordPress administrator because images and media files make up a significant portion of total site size and directly impact loading speed. Poor media file management can lead to an overloaded server, slow pages, and poor user experience. This guide covers everything you need to know from basic upload to advanced optimization techniques.

Uploading files

Upload methods

WordPress offers several ways to upload media files. Drag and drop is the simplest method where you drag files from your computer directly into the browser window on the Media Library page or within the editor. The upload button opens the system dialog for selecting files from your computer. Bulk upload enables uploading multiple files at once by selecting multiple files in the dialog. FTP upload is an option for large files or many files where you copy files directly to the uploads directory and then use a plugin like Add From Server to register them in the Media Library.

Supported formats

WordPress supports the most common media file formats by default. For images, that's JPG, JPEG, PNG, GIF, and WebP (since version 5.8). For videos, MP4, M4V, MOV, WMV, AVI, and OGV. For audio files, MP3, M4A, OGG, and WAV. For documents, PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX, ODT, and ODS. The SVG format is not supported by default for security reasons because SVG files can contain malicious JavaScript code. A plugin like Safe SVG adds SVG support with sanitization of potentially dangerous code.

Upload limits

The maximum upload file size depends on the server's PHP configuration, specifically the upload_max_filesize and post_max_size directives. On the WordPress hosting platform, the default limit is 128 MB but can be adjusted as needed. If you receive an error that the file exceeds the maximum size, contact your hosting provider to increase the limit or use a plugin like WP Maximum Upload File Size. For large video files, we recommend hosting on YouTube or Vimeo and embedding on the site instead of direct upload because video files consume a lot of space and bandwidth.

Media file organization

Default organization

WordPress organizes uploaded files by default into directories by year and month in the format wp-content/uploads/2026/09/filename.jpg. This can be changed in Settings, Media where you can disable date-based organization, but it's not recommended because a single directory with thousands of files can slow down the server. WordPress doesn't offer built-in support for categories or folders in the Media Library, which is a significant limitation for sites with many files.

Organization plugins

Media Library organization plugins add functionality WordPress doesn't have by default. FileBird creates virtual folders in the Media Library with drag-and-drop organization and unlimited folders in the free version. Real Media Library offers hierarchical folders with sorting and filters. Enhanced Media Library adds categories and tags for media files with filtering by taxonomies. Media Library Organizer enables creating categories with automatic sorting by file type, date, or author.

File naming

Proper file naming before upload is important for both organization and SEO. Use descriptive names like accounting-firm-website.jpg instead of IMG_4523.jpg. Use hyphens instead of spaces and underscores because they're more SEO-friendly. Avoid special characters, Cyrillic, and diacritics in filenames because they can cause issues on some servers. WordPress automatically converts spaces to hyphens but doesn't change the rest of the name, so it's better to properly name the file before upload.

Image optimization

Why optimization matters

Images are usually the largest resources on a web page — see our guide on optimizing images for the web — making up on average 50 to 70 percent of total page size. Unoptimized images dramatically slow down site loading, negatively impacting user experience, SEO ranking, and Core Web Vitals metrics. A 5 MB image that could be compressed to 200 KB without visible quality loss unnecessarily consumes bandwidth and prolongs loading time, especially for mobile users on slower networks.

Automatic compression

Automatic compression plugins reduce image size on upload without visible quality loss. ShortPixel offers lossy and lossless compression with a free plan for 100 images per month and WebP conversion integration. Imagify from the WP Rocket team provides three compression levels with visual before-and-after comparison. Smush is a popular free plugin with bulk compression and lazy loading. EWWW Image Optimizer works locally on the server without sending images to an external service, which is an advantage for sites with sensitive images.

WebP format

WebP is a modern image format that provides 25 to 35 percent smaller size than JPEG and PNG for the same visual quality. WordPress supports WebP since version 5.8 for upload and display. Plugins like ShortPixel and Imagify can automatically convert uploaded images to WebP format with a fallback to the original format for older browsers that don't support WebP. AVIF is an even newer format with even better compression but browser and WordPress support is still limited.

Image dimensions

WordPress automatically creates multiple sizes of each uploaded image defined in Settings, Media. Default sizes are thumbnail 150x150, medium 300x300, and large 1024x1024 pixels. A theme can register additional sizes with the add_image_size function. Use the appropriate image size for each context instead of loading the full-size image everywhere because that unnecessarily consumes bandwidth. The maximum width for full-size images should be 1920 to 2560 pixels because wider images don't make sense for web display.

Bulk actions

Built-in bulk actions

The WordPress Media Library in list view provides basic bulk actions. Select multiple files by checking the checkbox, choose an action from the dropdown, and click Apply. The default bulk action is permanent deletion of selected files. Grid view in the Media Library doesn't support bulk selection, which is a limitation for users who prefer visual file preview.

Bulk action plugins

Plugins extend the bulk capabilities of the Media Library. Media Cleaner scans the site and identifies unused media files not connected to any post, page, or widget and enables bulk deletion with a backup option before deletion. Bulk Auto Image Alt Text automatically generates alt text for all images that don't have it using the filename or AI-generated description. Enable Media Replace allows replacing an existing file with a new one while keeping the same URL, eliminating the need to update all references to the old file. Media Library Assistant adds advanced bulk actions including bulk editing of alt text, descriptions, and categories.

Thumbnail regeneration

When regeneration is needed

Thumbnail regeneration is needed when you change the theme because a new theme may have different registered image sizes, when you change image dimensions in Settings, Media, when you install a plugin that registers new image sizes, or when you apply new optimization and want it applied to all existing images. Without regeneration, old images remain in their original dimensions, and new sizes are created only for newly uploaded images.

Regeneration tools

Regenerate Thumbnails is the most popular plugin for this purpose with over a million active installations. It enables thumbnail regeneration for all images or individually with a progress bar and an option to delete old sizes the new theme doesn't use. The WP-CLI command wp media regenerate is a faster alternative for sites with many images because it runs in the command line without browser limitations. Force Regenerate Thumbnails deletes all old thumbnails before regeneration, freeing up space but taking longer.

Cleanup of unnecessary sizes

Each uploaded image can generate 5 to 10 or more thumbnails depending on the theme and plugins. For a site with 1000 images, that can be 5000 to 10000 files taking up significant disk space. Image Cleanup and JERL Media Cleaner help identify and delete thumbnail sizes no site element uses. Before deletion, always make a backup because deleting the wrong files can break the site's appearance.

Alt text and SEO for images

Importance of alt text

Alt text describes image content for users with screen readers and for search engines that can't see images. Google uses alt text to understand image content for ranking in Google Images results. Good alt text is short but descriptive, describes what's in the image rather than what the image is like, contains a relevant keyword when natural, and isn't keyword-stuffed. For example, good alt text for an office image is "Accounting firm team in the office" instead of "accounting firm belgrade services".

Bulk alt text updates

If you have many images without alt text, manually adding it for each is impractical. The Auto Image Alt Text plugin can automatically generate alt text based on filename for all images at once. For higher-quality alt text, use AI-based plugins that analyze image content and generate descriptive text. Media Library Assistant enables bulk editing of alt text in an Excel-like table, speeding up the manual process for sites where human precision is needed.

Media Library security

The Media Library can be a security risk if not properly configured. Disable direct listing of the uploads directory by adding Options -Indexes to the .htaccess file to prevent unauthorized viewing of all uploaded files. Limit allowed file types to only those you need because allowing PHP files or other executable formats to be uploaded can be exploited for attacks. Use a plugin to scan uploaded files for malware. Regularly check the uploads directory for suspicious files, especially PHP files that shouldn't be in the uploads directory.

Conclusion

The WordPress Media Library is a powerful tool that with the right approach and plugins can efficiently manage thousands of media files. Proper naming, folder organization, automatic compression and WebP conversion, regular thumbnail regeneration, and descriptive alt text are key to a fast, organized, and SEO-optimized site. At BeoHosting, our hosting packages provide enough space for your media files with fast SSD drives that ensure quick image serving and excellent user experience for your site's visitors.

BeoHosting Team

10+ years of experience — Web hosting and infrastructure specialists

  • Web Hosting
  • WordPress Hosting
  • VPS
  • Dedicated Serveri
  • Domeni
  • SSL
  • cPanel
  • LiteSpeed
  • Linux administracija
  • DNS

Last updated: