Deleting Images in a Post Does Not Delete the Image

| May 18, 2012 | 0 Comments

Deleting An ImageHow many times have you clicked that little red circle to delete an image from your post directly within the post editor, and mistakenly thought that the image was deleted out of WordPress for good? 

For example, lets say you uploaded an image to use in your post, and for whatever reason, you decided not to use it.  Maybe you changed your mind, did not like its appearance, the file was corrupted, or you experienced a server error, and were forced to try again.
I have some unfortunate news for you; that image is still stored in your WordPress Media Library, and worse, is still attached to that particular post.  You may not see it, but it is there stealing much-needed bandwidth on your server, and slowing your site down.

Duplicate Content imageNot to mention, causing duplicate content issues for you without even knowing it.  Let me explain…

Lets say you are writing a post about ‘how to make brownies.’  You upload a photo and use “Brownie” as your alt tag.  Then you experience a server error or you decide that you don’t like that pic, so you click that pretty little red circle to remove it, and upload another.  Lets say you go through this process 5 times (it happens), and each time, you are still alt tagging your image with “Brownie.”  You now have 5 images being stored in your media files, creating 5 individual image pages (because WordPress can be idiotic sometimes), and all of them possess the same alt tag.  You now have 5 pages of duplicate content the next time that Google shows up to crawl your site.  Do this is few hundred times over time, and you will literally have a mess of useless and problematic files.  Like I said, you may not see these images in your post, but they are there whether you like it or not.

This is another lesson that I had to learn the hard way.  Unfortunately, since I have pretty much taught myself how to use WordPress, I am forced to learn everything the hard way. 

This was an ongoing issue that I never noticed until I was using a plugin to regenerate post thumbnails in order for them to display correctly in my archive pages next to my post excerpts.  I was scrolling through each archive page to ensure that everything appeared as it should and started noticing a bunch of photos that I did not remember using in my posts. 

WordPress Media Library imageI’ll stress this again, your duplicate images are still attached to the post whether you see them or not, so when my WordPress theme was grabbing the first post image to display in my archive results, it was grabbing files that were not physically in the post.  This made me start to worry.  So I headed over to my media library, started scrolling through the files, and realized the mess that I had made over the last year.

Long story short, I was up until 2:00 am last night deleting duplicate images in my media library.  I originally had 1,030 images throughout more than 300 individual posts.  While searching through my media library, I found more than 200 duplicate images sitting there wasting space, and causing duplicate content issues that I did not even realize that I had.

The simple fix…

The solution is simple.  If you unattach an image from a post, just right click on your “Media” tab on your dashboard, and open it in a new window.  Find the image that you are not using in your post, and delete it permanently.  Or just simply remember to take care of this after you have published your new post.  The most recent uploads are listed first in your Media Library.  The duplicates that follow are most likely your culprits that need to be removed. 

I know that this sounds tedious, but trust me; do things correctly the first time around.  This will save you an enormous amount of time later on down the road.  I spent 5 hours last night deleting my duplicate images, and I only have 1000 or so.  Imagine how much time you’ll spend if you have more!  Plus this keeps your WordPress installation all neat and tidy.

Need help resizing an image? Check out our latest article on How To Re-size An Image In WordPress.

Category: WordPress

About the Author ()

Dave Fennell is the founder and editor of Marketing Methods Online and BloggerGo. Learn more about him here. You can also connect with him on Facebook, Twitter, and Google+

Leave a Reply