コンテンツへスキップ
Jetpack

個別の製品

セキュリティ
VaultPress Backup Scan Akismet Anti-spam
パフォーマンス
サイト検索 Boost VideoPress
成長
Stats ソーシャル ニュースレター SEO Blaze CRM
管理
Manage モバイルアプリ

製品バンドル

Pro WordPressサイト向けのセキュリティ、パフォーマンス、成長支援ツールです。 完了 より高いサービス上限を備えたJetpackの全機能。
料金
概要 Jetpack AI がサイトにできること スキル エージェントに WordPress のスーパーパワーを ドキュメント AI エージェントの接続と設定 はじめに ChatGPT、Claude、コーディングエージェントを接続 比較 Jetpack と他の WordPress MCP コネクタの比較

エージェントを接続しよう。無料です。

ChatGPT や Claude を接続して、サイトの運営を任せましょう。有料プランは不要です。

ChatGPT 版を入手 (新しいタブで開きます) または Claude を使う (新しいタブで開きます)
サポート チームによるガイドとサポート ドキュメント Jetpack の各機能の使い方ガイド 機能リクエスト Request features and vote on ideas ブログ ニュース、製品の最新情報、使い方ガイド
概要
ログイン 始める
セキュリティ
VaultPress Backup Scan Akismet Anti-spam
パフォーマンス
サイト検索 Boost VideoPress
成長
Stats ソーシャル ニュースレター SEO Blaze CRM
管理
Manage モバイルアプリ

製品バンドル

Pro 完了
料金
概要 Jetpack AI がサイトにできること スキル エージェントに WordPress のスーパーパワーを ドキュメント AI エージェントの接続と設定 はじめに ChatGPT、Claude、コーディングエージェントを接続 比較 Jetpack と他の WordPress MCP コネクタの比較

エージェントを接続しよう。無料です。

ChatGPT や Claude を接続して、サイトの運営を任せましょう。有料プランは不要です。

ChatGPT 版を入手 (新しいタブで開きます) または Claude を使う (新しいタブで開きます)
サポート チームによるガイドとサポート ドキュメント Jetpack の各機能の使い方ガイド 機能リクエスト Request features and vote on ideas ブログ ニュース、製品の最新情報、使い方ガイド
概要 検索
ログイン 始める

ブログ / Jetpack 101

How to Clean Up the WordPress Media Library: Remove Unused Images & Media

Rob Pugh のアバター

Rob Pugh 3月 2, 2022 · 読了時間の目安: 10分


このページの内容

  1. Why you should clean up your WordPress Media Library
  2. What to do before you delete unused media files in WordPress
  3. How to clean up your WordPress Media Library
  4. What to do after you clean up your WordPress Media Library
  5. Remove unused images to keep WordPress running smoothly

読了時間の目安: 10分

As your WordPress website grows, you may end up accumulating hundreds, if not thousands, of images. While hosts aren’t usually stingy when it comes to storage space, it still makes sense to clean up your website. If you don’t, you might find yourself with a massive collection of unused media files that can slow things down.

Fortunately, WordPress makes it easy to both upload and delete media files. That means there’s no excuse not to tidy up your image collection from time to time. Once you do, you should see your site running more smoothly and your workflows improved.

In this guide, we’ll discuss why you may want to clean up your WordPress Media Library. We’ll then show you how to prepare for that process, two ways to do it, and some maintenance tips for when you’re finished. Let’s dive in!

Why you should clean up your WordPress Media Library

In your personal life, you may have plenty of good reasons to keep files you don’t access on a daily basis. For example, you might need to hold on to official documents or important receipts. But it can be more difficult to justify a large reserve of media files on your website.

Most hosting plans have a limit on storage, so even if you have a generous amount of space, you’re bound to run out if you’re not careful. And when it comes to websites, media files usually take up the bulk of your quota. This is especially true if you use high-resolution and non-optimized images, which take up a lot of room.

Consider how many images you use on average for pages or blog posts. Even on a modest website, it’s not uncommon to have hundreds of media files.

As you update landing pages, refresh blog posts, or add new products, old media files may no longer be needed. But if you don’t remove them from the library, they still sit there — taking up space and making it all the more difficult to find the right files. You don’t want to sift through dozens of pages of files to find that one photo you need right away. Like a tidy workspace, a well-organized media library is worth the effort for the time and frustration it might save you every single day.

WordPress media library with a variety of images

On occasion, having too many images on your server can also slow down your WordPress website. However, that’s usually only the case if you’re loading a page with a massive number of files and can easily be avoided by using a Content Delivery Network (CDN). 

More importantly, if your Media Library is packed, this can be carried over to your backups, especially if they’re not incremental. This can cause site migrations and restorations — in addition to backups — to take much longer than necessary.

What to do before you delete unused media files in WordPress

Before you start deleting files from your Media Library, we recommend that you back up your website in its entirety. That way, if you delete any files that you can’t re-upload from your computer, you can revert to that backup.

There are a lot of ways to back up WordPress. Depending on your web host, you might have access to automated backups that you can restore from your hosting control panel. But in most cases, your best bet is to use a WordPress backup plugin like Jetpack Backup.

With Jetpack Backup, every change you make to your site is saved to the cloud in real time. That means you won’t need to create manual backups before updating your site, and you’ll always have recent copies available if something goes wrong.

Alternatively, if you’re planning to delete a large number of media files from WordPress, you might want to use a staging site. When you’re confident that you didn’t delete any critical media files, you can push that site live.

How to clean up your WordPress Media Library

Cleaning up media files in WordPress is remarkably simple. There are two ways you can go about this process: through the WordPress dashboard and via File Transfer Protocol (FTP). 

1. Clean up media files in your WordPress dashboard

To get started, log in to your WordPress dashboard and go to Media → Library. When you do, the WordPress Media Library will open and you’ll be able to navigate through all of the images and videos you’ve uploaded to your site.

files in the WordPress media library

Deleting any single file within the Media Library is simple. Just click on the image or video that you want to remove and a window will pop up. The window will include a preview of the media file, relevant information, and its metadata.

individual media file with options in the Media Library

If you look at the bottom right corner of this screen, you’ll see an option labeled Delete permanently. Click on it and confirm your decision.

Although this process is simple, it can be very time-consuming if you need to delete a large number of media files. If that’s the case, you can return to the main screen of the Media Library and look for the Bulk Select button in the menu near the top of the page.

bulk select option in the Media Library

Click on Bulk Select, and choose the files you want to remove. When you’re ready, select the Delete permanently option at the top of the screen.

the option to permanently delete images in WordPress

WordPress will ask you to confirm the decision. After you do, the files will be gone. If you have multiple pages of media files, you’ll need to complete this process page by page.

2. Delete unused WordPress media files via FTP

Just as you can upload files to your media library via FTP, you can also use an FTP client to delete large numbers of media files at once. The advantage of this approach is that it can remove entire years or months of media files in a matter of seconds.

To get started, you’ll need to connect to your website via FTP. If you don’t have an FTP client, we recommend using one that enables you to preview media files, like SmartFTP or Cyberduck.

Most web hosts will provide you with a set of FTP credentials when you sign up for a plan. If you don’t have access to those credentials, you should be able to create a new FTP account through your hosting control panel.

Once you connect to your server, you’ll need to find the WordPress ‘root folder.’ It contains all of the files and subdirectories that make up your website. Usually, it’s called something like public_html, public, www, or your website’s name.

When you locate the root folder, go ahead and open it. You’ll see a file structure that looks something like this:

files in the public_html folder of a website

Next, find your WordPress media files in the wp-content/uploads directory. Inside, you’ll see folders for every year that your website has been around. Each year will contain subdirectories for individual months.

folders within the uploads directory

If you know what media files you want to delete by name, you can select them in bulk, right-click anywhere within the client, and then choose the Delete option.

This is where an FTP client that shows previews for media files may come in handy (like ForkLift or Commander One). With this option, it will be easier to determine which files to delete, even when you can’t identify them by name.

What to do after you clean up your WordPress Media Library

After you delete all of the unused media files in your library, there are a few things we recommend you do to complete the cleanup process. Fortunately, with the right tools, they’re very straightforward tasks.

1. Disable attachment pages in WordPress

By default, WordPress creates a new page for every media file you upload to your website. They’re called ‘attachment pages‘ (or attachment posts), and in most cases there’s no reason to use them.

What’s more, if one of your images becomes popular (a lot of people are clicking on it), search engines might link to the attachment page directly. So you can end up getting clicks for a page that only includes an image or a video, and that doesn’t link to any other pages within your site.

After you remove unused images, you can end up with attachment pages that don’t have media files. That’s why we recommend disabling attachment pages entirely. This will also help keep your Media Library in check moving forward.

The easiest way to do this in WordPress is to use a Search Engine Optimization (SEO) plugin. You likely already have one installed, but if not, Yoast SEO and All In One SEO both include this feature.

If you’re using Yoast, go to SEO → Search Appearance → Media and look for the Media & attachment URLs option. Under ‘Redirect attachment URLs to the attachment itself?’ select Yes, and Yoast will disable attachment pages for media files.

Yoast settings for media and attachment URLs

Alternatively, if you’re using All In One SEO, go to All in One SEO → Search Appearance, and select the Image SEO option from the drop-down menu at the top of the screen. On the next page, beside the Redirect Attachment URLs setting, select Attachment Parent.

attachment URL settings in All in One SEO

This option will automatically redirect users who land on attachment pages to the posts where those images can be found. If the images don’t exist anymore, the pages themselves won’t show up.

2. Check for missing images on your website

Unfortunately, when you’re cleaning up your WordPress library, you may accidentally delete some files that you didn’t intend to. You might not even notice until you’re browsing the website, and you run across a page that isn’t loading images you know should be there.

To avoid this, after you clean up your Media Library, we recommend that you check all of the main pages on your site to see if they’re missing any important images. If they are, you’ll need to re-upload those files or restore a recent site backup.

The easiest way to check large numbers of pages for missing images is to use a plugin like Broken Link Checker. This plugin can scan your site for broken links and images, so you don’t have to do so manually.

Once you install and activate this plugin, simply go to Settings → Link Checker and proceed to the Which Links to Check tab. Here, you’ll find multiple options for links and media files that the plugin can check. 

If you just want to make sure you’re not missing any images, select the HTML images option and then click on Save Changes.

settings for checking broken media links

Go to the General plugin settings tab and you’ll find an overview of any missing images the plugin was able to locate. If you see a message that says No broken links found, that means you’re not missing any images.

Now you can go back to working on updating and improving your site. In most cases, you won’t need to clean your Media Library again for at least a few months.

3. Optimize your remaining images

Images are usually some of the largest files on a WordPress site and, because there are so many, can really slow things down. This is a big deal because users hate slow sites and search engines do, too. 

Optimizing your images can go a long way without sacrificing quality. And this has the added benefit of taking up fewer server resources, which is particularly helpful on shared hosting plans.

The easiest way to do this is by using a WordPress image CDN like Jetpack. This tool automatically compresses images for fast delivery and even delivers the right file formats and sizes based on the device type a visitor is using. And all of this is done behind the scenes, without any work required on your end.

Remove unused images to keep WordPress running smoothly

If you’ve been running your website for a while, you probably have dozens of media files you’re not using anymore. That’s why occasionally cleaning up your WordPress Media Library is a wise idea. Removing unused images and files will free up storage and make your backups smaller and more manageable.

You can remove files directly from your Media Library in WordPress, or use an FTP client to delete them in large batches. Regardless of which approach you take, you’ll want to make sure to back up your site before deleting any files, and ensure that you haven’t thrown out anything essential when you’re done.

If you don’t have a backup solution in place, you’ll definitely want to check out Jetpack Backup. It saves your site in real-time, so you’ll have every single detail in case of emergency. Plus, it keeps an activity log so you can select the exact point in time to which you want to restore. 

All of this is stored off-site on WordPress’ secure servers. So it won’t slow down your site and you can rest easy knowing your files are in good hands. 

いいね 読み込み中…
Rob Pugh のアバター

Written by

Rob Pugh

Rob works on building tools for creators and their audiences. He's focused on building an open, calm platform that will be loved by bloggers, newsletter publishers, podcasters, and readers alike. He's worked on marketing and product for 15 years, primarily at Automattic, Mailchimp, and UPS.

Jetpack のメリットを見る

Jetpack が WordPress サイトの保護、速度向上、成長にどう役立つかをご覧ください。

プランを見る

Questions about this post? Ask in the support forum

シェア


Keep reading.

More from Jetpack 101, newest first.

すべての投稿を見る

Jetpack 101 3月 31, 2026

WordPress Image SEO: 12 Techniques to Rank Higher & Load Faster

Are images helping or hurt…

Jen Swisher のアバター Jen Swisher 読了時間の目安: 14分

Jetpack 101 3月 26, 2026

WordPress Site Redirecting to Spam? Here’s How to Fix a Hacked Site

Uncover hidden malware, re…

Jen Swisher のアバター Jen Swisher 読了時間の目安: 12分

Jetpack 101 3月 24, 2026

WordPress Form with File Upload: How to Create One in 3 Steps

How to create a secure fil…

Jen Swisher のアバター Jen Swisher 読了時間の目安: 5分

AI ファーストで WordPress サイトを運営しよう。

Free to start, and AI agents are free to connect. Money back within 14 days on yearly plans.

始める Jetpack を無料で入手

WordPress プラグイン

  • Akismet アンチスパム↗ (新しいタブで開きます)
  • Jetpack↗ (新しいタブで開きます)
  • Jetpack ブースト↗ (新しいタブで開きます)
  • Jetpack CRM↗ (新しいタブで開きます)
  • Jetpack プロテクト↗ (新しいタブで開きます)
  • Jetpack 検索↗ (新しいタブで開きます)
  • Jetpack ソーシャル↗ (新しいタブで開きます)
  • Jetpack VideoPress↗ (新しいタブで開きます)
  • VaultPress バックアップ↗ (新しいタブで開きます)
  • WP Super Cache↗ (新しいタブで開きます)
  • ダウンロード

AI

  • Jetpack AI
  • スキル
  • WordPress MCP

パートナー

  • パートナープログラム
  • おすすめのホスティング事業者
  • ホスティング事業者向け
  • 代理店向け
  • アフィリエイト向け

開発者

  • ドキュメント↗ (新しいタブで開きます)
  • ベータプログラム
  • GitHub の Jetpack↗ (新しいタブで開きます)

ヘルプ

  • ナレッジベース
  • フォーラム↗ (新しいタブで開きます)
  • レビューとお客様の声
  • お問い合わせ
  • Jetpack について
  • プレス
言語を選択 日本語
  • English
  • Deutsch
  • Español
  • Français
  • 日本語

© 2026 Automattic Inc. 無断転載を禁じます。

  • 利用規約↗ (新しいタブで開きます)
  • プライバシーポリシー↗ (新しいタブで開きます)
  • GDPR

によって心を込めて制作されています。

App Storeからダウンロード Google Playで入手
コメントを読み込み中…
  • リブログ
  • 定期購入 開始日
    Jetpack
    53,354人の購読者に加わりましょう

    WordPress.com のアカウントをお持ちですか ? 今すぐログインしてください。

  • Jetpack
    短縮リンクをコピーReader で投稿を表示
    購読管理登録ログイン
    このコンテンツを報告
    このバーを折りたたむ
%d