# Why does Plex delete folders empty?

**URL:** https://forums.plex.tv/t/why-does-plex-delete-folders-empty/184966
**Category:** General Discussions
**Created:** [March 17, 2017, 4:37pm UTC](https://forums.plex.tv/t/why-does-plex-delete-folders-empty/184966 "2017-03-17T16:37:06Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![ger.kehoe](https://avatars.discourse-cdn.com/v4/letter/g/b9e5f3/32.png) [@ger.kehoe](https://forums.plex.tv/u/ger.kehoe)
#### Post date: [March 17, 2017, 4:37pm UTC](https://forums.plex.tv/t/why-does-plex-delete-folders-empty/184966/1 "2017-03-17T16:37:06Z")

</div>

So I have a folder structure like this:

TV  
----Cop Shows  
----------Show1  
----------Show2  
----Drama  
----------Show3  
----------Show4

When I have watched an episode I always delete it thru Plex. However in the most recent versions of the server, when the episode being deleted is the last file in the folder, the folder is also deleted. This is very annoying and I assume it is a bug. Is there a setting to disable this? I can’t find one but may be missing it.  
If there isn’t an option then Plex should not be deleting folders when it was only asked to delete a file.

Thanks.

---

<div class="post-metadata">

### Author: ![JuiceWSA](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/juicewsa/32/12253_2.png) [@JuiceWSA](https://forums.plex.tv/u/JuiceWSA)
#### Post date: [March 17, 2017, 5:00pm UTC](https://forums.plex.tv/t/why-does-plex-delete-folders-empty/184966/2 "2017-03-17T17:00:55Z")

</div>

No bug - that is the intended behavior (at this time).

Note:

TV \<— if that is your TV Show Library this structure is destined to fail.  
----Cop Shows \<— if this is just one of your TV Show Libraries - all is well.  
----------Show1  
----------Show2  
----Drama  
----------Show3  
----------Show4

This isn’t what’s causing the folder deletion, but while you wait for Plex to notice they’re not making some users happy with their design change and scramble to fix it (that’s funny just thinking about it and even funnier when I write it down) you could spend some quality time with your TV Show Library Structures/File Names (haven’t seen those yet) bringing them into compliance (if necessary):

> **[Naming 'Series' & 'Season' Based TV Shows | Plex Support](https://support.plex.tv/articles/200220687-naming-series-season-based-tv-shows/)**
>
> The scanners and metadata agents used by Plex will work best when your major types of content are separated from...

The current ‘work-around’ (and what most of us have been doing since day one for another reason) is to leave one ‘seed-episode’ in the folder.

---

<div class="post-metadata">

### Author: ![ger.kehoe](https://avatars.discourse-cdn.com/v4/letter/g/b9e5f3/32.png) [@ger.kehoe](https://forums.plex.tv/u/ger.kehoe)
#### Post date: [March 17, 2017, 5:08pm UTC](https://forums.plex.tv/t/why-does-plex-delete-folders-empty/184966/3 "2017-03-17T17:08:43Z")

</div>

Thanks…and yeah, my libraries are under the TV show level. So a library for Cop Shows, Drama, Comedy etc. It was all organised a couple of years ago when I started using Plex and never had an issue with it.  
All was fine until very recently and it worked brilliantly. Now with this issue and a distinct change in how auto-refreshing of folders is operating, (or not operating as the case may be) I have had to download EMBY again to see if it is any better. The last couple of weeks has really been a step backwards unfortunately for Plex.  
I read thru that page you linked and all is well with my structure I believe. Ill give that seed file a go. Does it have to be an actual episode or will something like a txt file do?

---

<div class="post-metadata">

### Author: ![ger.kehoe](https://avatars.discourse-cdn.com/v4/letter/g/b9e5f3/32.png) [@ger.kehoe](https://forums.plex.tv/u/ger.kehoe)
#### Post date: [March 17, 2017, 5:19pm UTC](https://forums.plex.tv/t/why-does-plex-delete-folders-empty/184966/4 "2017-03-17T17:19:14Z")

</div>

An empty txt fie works to stop it deleting the folder it seemswhen last episode deleted…thanks for the tip.

---

<div class="post-metadata">

### Author: ![JuiceWSA](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/juicewsa/32/12253_2.png) [@JuiceWSA](https://forums.plex.tv/u/JuiceWSA)
#### Post date: [March 17, 2017, 5:29pm UTC](https://forums.plex.tv/t/why-does-plex-delete-folders-empty/184966/5 "2017-03-17T17:29:45Z")

</div>

> @ger.kehoe said:  
> An empty txt fie works to stop it deleting the folder it seemswhen last episode deleted…thanks for the tip.

That’s handy info that can be passed on to the next user surprised by the new ‘feature’. I suggested just leaving the last episode in there, but if your method works, it works as a ‘work-around’.

I like leaving the last episode 'cause at my age I tend to forget what happened when I left it the last time - and as soon as I place a new episode in it snaps the new episode to On Deck right where I left off.

---

<div class="post-metadata">

### Author: ![sashalav](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@sashalav](https://forums.plex.tv/u/sashalav)
#### Post date: [March 20, 2017, 1:39pm UTC](https://forums.plex.tv/t/why-does-plex-delete-folders-empty/184966/6 "2017-03-20T13:39:06Z")

</div>

Plex should not be messing with folder structure at all, but if it does, this should not start as new default behaviour.

btw, this works on \*nix to create blank files in all folders  
find /path/to/your/library/ -type d -exec touch {}/empty.txt ;

---

<div class="post-metadata">

### Author: ![jwatilo](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@jwatilo](https://forums.plex.tv/u/jwatilo)
#### Post date: [March 24, 2017, 1:52am UTC](https://forums.plex.tv/t/why-does-plex-delete-folders-empty/184966/7 "2017-03-24T01:52:54Z")

</div>

They may say this is “by design”, but it’s BAD design to implement a destructive feature that changes prior behavior without making it a configurable option! And also without warning! I thought I was going crazy until I came across this thread.

Thanks all, for the work-arounds. Now I’m off to create a bunch of silly empty text files…

---

<div class="post-metadata">

### Author: ![JustSean](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/justsean/32/231573_2.png) [@JustSean](https://forums.plex.tv/u/JustSean)
#### Post date: [April 1, 2017, 12:24am UTC](https://forums.plex.tv/t/why-does-plex-delete-folders-empty/184966/8 "2017-04-01T00:24:12Z")

</div>

Well, this is absolutely unacceptable, and no reason to create such a design. As well, take into consideration those of us who use things like SIckbeard to place things in existing folders…well guess what…the folders are gone (by design!) and will cause failures.

Yes, an empty text file will work just fine, but that should not be necessary in the first place.

---

<div class="post-metadata">

### Author: ![JuiceWSA](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/juicewsa/32/12253_2.png) [@JuiceWSA](https://forums.plex.tv/u/JuiceWSA)
#### Post date: [April 1, 2017, 12:38am UTC](https://forums.plex.tv/t/why-does-plex-delete-folders-empty/184966/9 "2017-04-01T00:38:56Z")

</div>

I actually like the ‘new way’. I leave a ‘seed-episode’ in the folder, but when I don’t need the folder any more I like that I don’t have to hunt it down to delete it.

---

<div class="post-metadata">

### Author: ![JustSean](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/justsean/32/231573_2.png) [@JustSean](https://forums.plex.tv/u/JustSean)
#### Post date: [April 1, 2017, 12:54am UTC](https://forums.plex.tv/t/why-does-plex-delete-folders-empty/184966/10 "2017-04-01T00:54:14Z")

</div>

It wouldn’t mind it if it was an optional setting (off by default)

---

<div class="post-metadata">

### Author: ![cushtycom](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/cushtycom/32/91216_2.png) [@cushtycom](https://forums.plex.tv/u/cushtycom)
#### Post date: [April 1, 2017, 1:33pm UTC](https://forums.plex.tv/t/why-does-plex-delete-folders-empty/184966/11 "2017-04-01T13:33:52Z")

</div>

Thanks for the txt file solution - this was driving me nuts!

---

<div class="post-metadata">

### Author: ![hthighway](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/hthighway/32/82003_2.png) [@hthighway](https://forums.plex.tv/u/hthighway)
#### Post date: [April 1, 2017, 1:49pm UTC](https://forums.plex.tv/t/why-does-plex-delete-folders-empty/184966/12 "2017-04-01T13:49:47Z")

</div>

@“MovieFan.Plex” mentioned another method in a different thread the other day…

Another option you can consider, instead of creating text files is to not use Show folders.  
Since you are not keeping the files, there is no need to organize them with the regular folder structure.  
Have the library point to a folder (D:\TV Show Episodes) for example, and stick all your files in there.

```auto
D:\TV Show Episodes\Show 2 - S05E07.mkv
...
D:\TV Show Episodes\Show 20 - S09E10.mp4

```

Even if this folder goes empty, Plex won’t delete it.

---

<div class="post-metadata">

### Author: ![Cyber-Surfer](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@Cyber-Surfer](https://forums.plex.tv/u/Cyber-Surfer)
#### Post date: [October 4, 2017, 9:14pm UTC](https://forums.plex.tv/t/why-does-plex-delete-folders-empty/184966/13 "2017-10-04T21:14:28Z")

</div>

Except if you have a device that requires DNLA due to not having a Plex app for the device… At which point, a large quantity of shows in one single folder makes life a headache… whereas seperating them into folders makes it easier to find what you are looking for…

Now get the Plex devs to make apps for older Blu-Ray Players (ones that have Netflix, and Hulu apps and such)… And then we can talk about not having to use DNLA…

---

<div class="post-metadata">

### Author: ![7up1n3](https://avatars.discourse-cdn.com/v4/letter/7/13edae/32.png) [@7up1n3](https://forums.plex.tv/u/7up1n3)
#### Post date: [January 19, 2018, 4:02pm UTC](https://forums.plex.tv/t/why-does-plex-delete-folders-empty/184966/14 "2018-01-19T16:02:29Z")

</div>

> @“ger.kehoe” said:  
> If there isn’t an option then Plex should not be deleting folders when it was only asked to delete a file.

This. Any statement from Plex on this?

Appreciate the empty text file recommendation, as a workaround.

---

<div class="post-metadata">

### Author: ![cory\_jackson](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/cory_jackson/32/16454_2.png) [@cory\_jackson](https://forums.plex.tv/u/cory_jackson)
#### Post date: [October 18, 2018, 6:40pm UTC](https://forums.plex.tv/t/why-does-plex-delete-folders-empty/184966/15 "2018-10-18T18:40:54Z")

</div>

I have experienced the deletions. I think I added a zero byte file to a folder that was then deleted. I am not sure so I set up a test with 3 folders. Empty, zero-byte TXT, and a TXT with some text. After a day I checked and they’re all still there. When does the empty folder clean-up occur?

---

<div class="post-metadata">

### Author: ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)
#### Post date: [January 7, 2020, 10:57pm UTC](https://forums.plex.tv/t/why-does-plex-delete-folders-empty/184966/16 "2020-01-07T22:57:44Z")

</div>


