• Start Here
  • Blog
    • Blogging
    • SEO
    • Themes
    • Plugins
    • Hosting
  • Tutorials
    • Create A Website
    • Start A Blog
    • WordPress SEO
    • Speed Up WordPress
    • WordPress Security
  • Tools
    • WordPress Hosting
    • Caching Plugins
    • Security Plugins
    • Comment Plugins
No Results
View All Results
GigaPress
  • Start Here
  • Blog
    • Blogging
    • SEO
    • Themes
    • Plugins
    • Hosting
  • Tutorials
    • Create A Website
    • Start A Blog
    • WordPress SEO
    • Speed Up WordPress
    • WordPress Security
  • Tools
    • WordPress Hosting
    • Caching Plugins
    • Security Plugins
    • Comment Plugins
No Results
View All Results
GigaPress

Where Does WordPress Store Images?

Brad Merrill by Brad Merrill
0
Where Does WordPress Store Images?
Share on FacebookShare on Twitter

Have you ever wondered where WordPress stores images on your server? Perhaps you need to access some image files you’ve uploaded in the past, or maybe you want to reorganize your media library.

In either case, it’s helpful to understand exactly how WordPress handles media uploads and attachments.

How WordPress Stores Images

You can upload images to your site by going to Media > Add New in your WordPress dashboard. You can either drag and drop or click “Select Files” to browse your hard drive.

Alternatively, you can add an image directly to a post by adding an image block and following the same process.

But where do these images end up?

The WordPress Media Library

All of the media files you upload through WordPress can be found at Media > Library in your dashboard.

This screen provides an intuitive way to manage your media uploads.

When you click on an item, you’ll see some more information about the file, and you can edit various metadata such as the alt text, title, caption, and description:

You can also delete the file by clicking “Delete Permanently.” This is the best way to delete media uploads from WordPress, as it deletes them cleanly without leaving data behind in the database.

Where WordPress Stores Image Files On Your Server

When you upload an image to WordPress, the image file itself (e.g. image.jpg) will be stored in the /wp-content/uploads/ directory on your server.

The default behavior is to organize this directory into folders based on upload date

For example, an image uploaded in July 2019 would be stored in /wp-content/uploads/2019/07/.

You can access these directories using your cPanel file manager or an FTP client like FileZilla.

How WordPress Stores Images In Your Database

WordPress stores information about your images and other media attachments in multiple locations within your database. You can use phpMyAdmin via cPanel to view and manage this data.

Media Attachment Data

WordPress stores information about the media you’ve attached to posts, pages, and custom post types in the wp_posts table of your database.

Your images and other media attachments will be labeled attachment in the post_type column.

Featured Image Data

WordPress also keeps track of featured images (also known as thumbnails) in the wp_postmeta table of your database.

In this case, you’re looking for rows with a meta_key of _thumbnail_id.

How To Properly Delete Images In WordPress

Deleting an image file using an FTP client or the cPanel file manager will remove it from your server, but it will not remove the associated metadata from your database. As a result, the image will still show up on your WordPress site and in your media library as a broken image:

Likewise, deleting image references from your database will remove them from your media library, but the image files themselves will still exist on your server.

The best way to delete an image in WordPress is to simply go to Media > Library in your dashboard, then use the Delete button for any items you’d like removed. This will simultaneously delete the file from your server while also removing the associated database references.

If for any reason you need to remove an image manually, be sure to delete both the file itself and any references in the database.

How To Change The Way WordPress Organizes Media Uploads

By default, WordPress organizes your media files into month- and year-based folders by upload date.

If you would like to disable this behavior and store all of your media files directly in /wp-content/uploads/, you can change this setting by going to Settings > Media in your WordPress dashboard.

From here, simply uncheck the box labeled “Organize my uploads into month- and year-based folders.”

Keep in mind, however, that if your site has a lot of uploads, this directory can become chaotic in no time.

If you want to take full control over your WordPress media folders, you can install the free WordPress Media Library Folders plugin.

WordPress Media Library Folders

We hope this guide has been helpful! If you have any other questions about where WordPress stores images, please leave them in the comments below!

Previous Post

How To Duplicate A Page Or Post In WordPress

Next Post

SiteGround WordPress Hosting Review: Is It Really The Best?

Brad Merrill

Brad Merrill

Brad Merrill is the CEO of Merrill Media and Editor in Chief of GigaPress.

Next Post
SiteGround WordPress Hosting Review: Is It Really The Best?

SiteGround WordPress Hosting Review: Is It Really The Best?

No Results
View All Results

Join The Community

Be the first to see the latest WordPress tips, tricks, tutorials, and reviews from GigaPress.

GigaPress is free and reader-supported. When you make a purchase through one of our links, we may receive a commission at no additional cost to you.

Essential Resources

How To Create A Website: Step-By-Step Beginner’s Guide
Tutorials

How To Create A Website: Step-By-Step Beginner’s Guide

December 9, 2020
How To Start A Successful Blog In 2021: The Definitive Guide
Blogging

How To Start A Successful Blog In 2021: The Definitive Guide

December 13, 2020
How To Speed Up Your WordPress Site: The Only Guide You Need
Tutorials

How To Speed Up Your WordPress Site: The Only Guide You Need

April 3, 2020
WordPress Security: The Complete Step-By-Step Guide
Security

WordPress Security: The Complete Step-By-Step Guide

August 13, 2019
WordPress SEO Tutorial: The Complete Guide To Higher Rankings
SEO

WordPress SEO Tutorial: The Complete Guide To Higher Rankings

July 19, 2019

Get The Newsletter

Join our newsletter to get the best WordPress tips and tutorials every week.
    GigaPress

    © 2021 GigaPress
    A Merrill Media Publication

    Site Links

    • Start Here
    • Tools
    • About
    • Contact
    • Privacy

    Follow Us

    No Results
    View All Results
    • Start Here
    • Blog
      • Blogging
      • SEO
      • Themes
      • Plugins
      • Hosting
    • Tutorials
      • Create A Website
      • Start A Blog
      • WordPress SEO
      • Speed Up WordPress
      • WordPress Security
    • Tools
      • WordPress Hosting
      • Caching Plugins
      • Security Plugins
      • Comment Plugins

    © 2021 GigaPress
    A Merrill Media Publication

    Welcome Back!

    Login to your account below

    Forgotten Password?

    Create New Account!

    Fill the forms bellow to register

    All fields are required. Log In

    Retrieve your password

    Please enter your username or email address to reset your password.

    Log In

    Session expired

    Please log in again. The login page will open in a new tab. After logging in you can close it and return to this page.

    >