Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPBカップ
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

WordPressはサイトのどこに画像を保存しますか?

編集メモ: WPBeginner のパートナーリンクから手数料を得ています。手数料は編集者の意見や評価に影響を与えません。編集プロセスについて詳しく知る。

WordPressがサイトの画像をどこに保存しているのか気になりませんか?

WordPress初心者の方から、WordPressがどのように画像を保存しているのか、メディアライブラリをより効率的に整理するためにはどうしたらよいのか、といったご質問をいただくことがあります。

この投稿では、WordPressがサイトにどのように画像を保存しているかを説明します。また、画像をより効率的に整理するためのツールやプラグインもご紹介します。

Where does WordPress store image files (Explained)

WordPressはどのように画像を保存するのか?

WordPressには、画像、動画、音声、ドキュメントなどのメディアアップロードを管理するシステムがビルトインされています

このシステムでは、WordPressホスティングサービスサーバーの特定のフォルダーに画像やその他のメディアを簡単にアップロードできます。

これらのファイルはメディアライブラリに表示され、メディア ” ライブラリのページで表示できます。

WordPress media library

ここから、これらのファイルを編集したり、操作したり、削除したりすることができる。

WordPressで画像ファイルを保存する特定のフォルダーは、/wp-content/フォルダーの中にあるアップローダーフォルダーと呼ばれます。

Uploads folder in WordPress

このフォルダーの中には、メディアファイルが年と月のフォルダーに保存されています。さらに、WordPressプラグインによって作成された、その他のアップロードを保存するフォルダーも表示されます。

例えば、2022年6月にアップロードされたメディアファイルはすべて、この場所に保存されます:

/wp-content/uploads/2022/06/

FTPクライアントを使用してWordPressホスティングサービスアカウントに接続するか、ホスティングアカウントのコントロールパネルにあるファイルマネージャーアプリを使用して、これらのファイルやフォルダを表示することができます。

Media uploads organized in year and monthly folders

サーバーにアップロードされた各画像のコピーが複数あることにお気づきでしょう。

これらの画像サイズは、画像をアップロードする際にWordPressが自動的に生成します。

Multiple image sizes

初期設定では、サムネイル、中、大サイズの画像がアップロード元と一緒に表示されます。

それとは別に、WordPressのテーマやプラグインが追加の画像サイズを生成することもあります。

さて、WordPressがメディアライブラリ内でこれらのファイルに関する情報をどのように表示するのか、不思議に思うかもしれない。

そのために、WordPressは画像のアップロードに関する情報も、投稿テーブルの下に添付ファイル投稿タイプとしてデータベースに保存します。

それ以外にも、WordPressは投稿/ページやその他のカスタム投稿タイプに画像を挿入した際に、投稿メタテーブルに情報を保存する。

Meta data for images stored in WordPress database

例えば、アイキャッチ画像を設定すると、WordPressはその情報を_thumbnail_idというメタ情報として保存します。

そして、それをデータベースの投稿メタ情報に保存する。

Image meta data stored in WordPress database

データベース内の情報は、WordPressにホスティングサービスサーバー上のファイルの場所を伝えます。

FTPを使ってサーバーからファイルを削除すると、WordPressはそれらの画像を壊れたものとして表示します。

Broken image in WordPress

同様に、WordPressデータベースから画像への参照を削除した場合、ファイルはホスティングサービスサーバー上にそのまま残りますが、メディアライブラリには表示されません。

WordPressが画像とメディアアップローダーを保存する方法を変更する

初期設定では、WordPressの管理エリアからアップロード場所を変更する権限がありません。

唯一の変更は、WordPressダッシュボードから設定 ” メディアページにアクセスして、月と年ベースのフォルダを無効化することです。

Media settings in WordPress

ここから、アップロードする画像の最大サイズをピクセル単位で調整することもできます。

WordPressの上級ユーザーは、WordPressの初期設定のアップロードフォルダーを手動で変更する方法のチュートリアルを参考にしてください。

WordPressで画像を整理する

ほとんどのユーザーにとっては、WordPressの初期設定のメディアライブラリで十分でしょう。

しかし、WordPressブログで画像がより重要な権限グループを担っている場合、アップロードを整理するための追加ツールが必要になるかもしれません。

例えば、写真サイトを運営しているのであれば、アルバムやタグでコンテンツを整理したいかもしれません。

そのためには、Envira Galleryのようなプラグインが必要です。これは、アルバム、タグ、ギャラリーで画像を整理することができる、市場で最高のWordPress画像ギャラリープラグインです。

Envira Gallery provides albums and tags functionality for images

WordPressでユーザーが画像をアップロードできるようにする

WordPressの初期設定では、サイトに投稿日を書けるユーザーであれば誰でも画像をアップロードすることができます。これには、管理者、投稿者、エディター、寄稿者の権限グループを持つユーザーが含まれます。

しかし、他のユーザーが管理エリアにログインせずにサイトに画像をアップロードしたいとしたらどうでしょうか?

そのためにはWPFormsプラグインが必要です。WPFormsはWordPressのお問い合わせフォームプラグインで、サイト用のフォームを簡単に作成することができます。

また、ユーザーアカウントを作成したり、WordPressの管理エリアにアクセスしたりすることなく、画像やドキュメンテーション、その他のファイルを簡単にアップロードできるファイルアップロードフィールドを備えています。

まず、WPFormsプラグインをインストールして有効化する必要があります。詳細については、WordPressプラグインのインストール方法のステップバイステップガイドを参照してください。

有効化した後、WPForms ” 設定ページにアクセスしてライセンスキーを入力してください。この情報はWPFormsサイトのお客様のアカウントの下にあります。

Entering your WPForms license key

次に、WPForms ” 新規追加ページで画像アップロードフォームを作成します。

まず、フォームのタイトルを入力してください。その後、ファイルアップロードフォームのテンプレートを探して始めましょう。

File upload form

WPForms はフォームビルダーのインターフェースを読み込み、フォームのプレビューを右側に、フォームフィールドを左側のカラムに表示します。

このフォームテンプレートには初期設定でファイルアップロードフィールドが含まれています。フォームにフィールドを追加もしくは削除したり、ラベルを変更したり、上下に移動させたりすることができます。

File upload form editing

ファイルアップロードフィールドをクリックして、設定を変更することができます。ここから、ユーザーがアップロードできるファイルの種類と数を設定できます。また、ファイルサイズの上限を設定することもできます。

詳しい手順については、WordPressでファイルアップロードフォームを作成する方法のチュートリアルをご覧ください。

File upload settings

入力が終わったら、フォームを保存してフォームビルダーを終了します。

次のステップでは、新しい投稿かページを作成するか、既存の投稿を編集します。投稿編集画面で、WPFormsブロックをコンテンツエリアに追加します。

Add form to your WordPress website

次に、WPFormsブロック内のドロップダウンメニューをクリックして、先ほど作成したフォームを選択します。

これで変更を保存し、投稿やページをプレビューしてファイルアップロードフォームの動作を確認することができます。

File upload form

その後、WordPressダッシュボードからWPForms ” Entriesページにアクセスすることで、ユーザーによってアップロードされたすべてのファイルを表示することができます。

ここで、ファイルアップロードフォームをクリックしてエントリーを表示し、アップロードされたファイルを確認します。

User entry

詳しくは、WordPressでユーザーが画像をアップロードできるようにする方法についての完全ガイドをご覧ください。

ボーナス:WordPressの画像を最適化する

Imagelyは非常に魅力的なので、ユーザーにとってより興味深いコンテンツになります。しかし、単なるテキストよりも読み込みに時間がかかります。

つまり、1ページに複数の大きな画像を使用すると、ウェブページの読み込みが遅くなります。このページスピードの遅さは、ユーザーエクスペリエンスだけでなく、SEOにも影響します。

幸いなことに、WordPressにアップロードする前に、画像を ウェブ用に簡単に最適化 できるツールがたくさんあります。

例えば、EWWW Image OptimizerのようなWordPressの画像圧縮プラグインを使えば、サイトにアップロードする各画像を自動的に最適化することができます。

EWWW Image Optimizer

CDN(コンテンツデリバリーネットワーク)を利用すれば、さらにパフォーマンスを高めることができます。これにより、ホスティングサービスのサーバーではなく、グローバルなサイトネットワークから画像を読み込むことができます。

私たちは、市場で最高のCDNサービスであるBunny.netを使用することをお勧めします。非常に簡単で、WordPressのプラグインが付属しているため、セットアップも簡単です。

この投稿が、WordPressがサイト上の画像を保存する場所について知っていただく一助となれば幸いです。また、WordPressブログ用のロイヤリティフリー画像の探し方や、WordPressの裏側の仕組みについての初心者向けガイドもご覧ください。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

情報開示 私たちのコンテンツは読者支援型です。これは、あなたが私たちのリンクの一部をクリックした場合、私たちはコミッションを得ることができることを意味します。 WPBeginnerの資金源 をご覧ください。3$編集プロセスをご覧ください。

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

究極のWordPressツールキット

ツールキットへの無料アクセス - すべてのプロフェッショナルが持つべきWordPress関連製品とリソースのコレクション!

Reader Interactions

37件のコメント返信を残す

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Jiří Vaněk says

    By default, WordPress media is stored in the wp-content/upload folder. Is it possible to change it to another folder in the configuration?

  3. Moinuddin Waheed says

    While we upload any image it gets uploaded inside the media gallery of the wordpress.
    while it gets into different months folders by default it becomes handy to organise and access them but at times it becomes hard to find a particular image if not informed of the month of upload.
    Does images of all kinds whether posts or pages gets into monthly folder or only the posts or articles images go inside monthly folder?

    • WPBeginner Support says

      All of the images should be included in the folders but you should be able to search by title to find the image in your media library.

      管理者

  4. Omar Abrahim says

    Hi,

    The uploads folder is critical, correct? While there are probably references to the images / files stored in the WP database, the actual files in the uploads folder are needed, as they are not stored in the databse. Do I have that right?

  5. guy says

    hi
    i have about 100 images in my gallery.
    when i looked at the download images in the server, i sow almost 1000.
    same image 10 times.. with different resolution.
    why is that?
    how do wordpress store images?
    thanks

  6. Gabriel Bartholomeu says

    If I only move the files to wp-content folder, does it still creates a reference in database?

  7. Pratik Patel says

    Hello Admin,

    I have some issues in automated Generated URLs,

    I have some URLs that includes only individual images in body from the rest of the website URLs, and they are indexed in Google. I wanted to remove this type of URLs from the Google Index.

  8. Luis Garcia says

    Hi,

    I have been working in a website. It is a redesign of an already existing page, so what I did was: I exported all posts and pages through WP Exporter, but the images were missing. So, now the posts that had galleries don’t have the galleries, they don’t show up. Later, and as I was really advanced, I realized I should’ve exported and imported the database as well. Long story short, now I am trying to recover those images and make them appear in my current site. Is there a way to blend the last database with the new one?
    Thanks a lot.

  9. Lucy says

    Hi,
    Thanks a lot for your help!!!

    Is there a plugin which can help to remove all the images not actualy used in any posts or pages?

    Thank you.

  10. Nitish says

    Hello
    how to upload user images from custom template to custom folders and also in database table.

    Pls help
    Thanku.

  11. Adam says

    Hello – Are there other places that WP can store images? I’ve taken over a legacy site (a pretty new site) and an image i need to replace is not located in the media library but does not appear to be hosted outside the site.

    • John says

      Hi Adam, did you ever figure this out? I’m running into the same issue. I have a list of images that are too big in file size, so I am going through the site and reducing these to optimize our site upload time. I’m having no luck with finding ANY images that contain “/legacy” in the URL.

  12. Mahmoud Momani says

    Hello,
    Thanks for the article.
    I have a question about converting an ASP.NET website to wordpress, if you can write an article describing the required tables and how to insert data in it.
    Thanks.

  13. Holly says

    If I delete and image from my media library after posting it to my site will it delete the image off of my site as well?

  14. Ruth Billheimer says

    Am I right in thinking that having a lot of images in the media library doesn’t slow up the site? I’m trying to get my head round the way pages load, to try and get a better speed. So if you have a lot of images on a page, they will slow it up but it doesn’t matter how many images you have stored. Is that right?

  15. nilesh nolkha says

    I had one question regarding SEO of images. When you upload pics in media library, you can suggest a title, caption and alt text. Similarly when you are actually adding that media to the post pr image widget on page builder, you again can enter title, caption, alt image etc. Does it matter if we do it once or we have do it again for the media while adding it to a post ? How it is different

    • Ruth Billheimer says

      I think the caption can vary depending on where you’re using the image but the others stay the same. The alt text should be different from the title, or you can mark the image as decorative. If you have an accessibility plugin for people with a visual impairment, you also have to fill in the description.

  16. Sandy Ellingson says

    Is there a way to export a list of items in the media file with the associated links? I found this post while trying to answer this question. I have looked for the wp_post file via phpmyadmin and can’t find it. Perhaps this is an old post?

  17. Marc Connor says

    Do you guys recommend using your own image folder structure via FTP?

    I like to create a folder in the root called “images”, and store the images there. Well, as many as that particular WordPress t heme would let me.

    Is that better or worse than the default date-based structure?

    Sincerely,
    Marc

  18. Bob says

    I built a website on my churches server. So now when I’m building my personal site which is a different server. I see all of the media of my churches site with my personal. Oh I built them on my laptop.

  19. jabbo126 says

    It’s shame, that WordPress still haven’t better media files upload solution with better folder organization.

  20. Ikramullah says

    Hi,
    My attached one of images are not shown as image tag beside starting paragraph as a tag.
    How to enable this feature?

    I need this info.

    Thanks.

  21. vijay jangra says

    Hello editorial staff members, i have read and seen your many blog posts. I have a question in mind.
    How to build these beautiful images for your blog posts.

  22. kif says

    hello, can you tell us why wp crop images? even when i upload i single one?

    thank you for your daily edition emails!

    • Kevin says

      WP automatically creates thumbnails, and versions for various sizes (small, medium, large, etc) for use with various devices on responsive website. So generally you’ll have the original size + the various auto-created sizes. You can then pick the appropriate size when adding an image to a page/post and WP will then serve the correct version for the device being used.

返信を残す

コメントありがとうございます。すべてのコメントは私たちのコメントポリシーに従ってモデレートされ、あなたのメールアドレスが公開されることはありませんのでご留意ください。名前欄にキーワードを使用しないでください。個人的で有意義な会話をしましょう。