<p>Is it possible to pragmatically delete a matrix block based on its content? I have a channel called "Artist", which has a matrix field with concerts. It'll be about 5-600 concerts in total every year, so it's a bit of a hassle to manually remove old concerts. Every block has a field with the concert date. Is it possible to remove matrix blocks based on that date?</p>

CC BY-SA 3.0
2015-07-17T13:40:12.293Z
I'm curious, why do you feel you need to delete the old content? Can't you just show events with relevant dates?
Steve Rowling
CC BY-SA 3.0
2015-07-17T14:27:39.027Z
Instead of a matrix of concerts, you might have a channel of concerts, which could have an expiration date like other events.
Marion Newlevant
CC BY-SA 3.0
2015-07-18T12:06:16.263Z
@SteveRowling It will end up being a mess on the backend with 600 concerts in a year. It'll be near impossible to find anything after only a short while.
peirix
CC BY-SA 3.0
2015-07-18T12:06:57.873Z
@MarionNewlevant The reason I can't have concerts as channels is because I'm using the free version, which only has one channel section. And it would still be a big mess with 600+ entries.
peirix
<matrix>
Delete matrix blocks based on their content
# Delete matrix blocks based on their content

(Asked by: username_0 on 2015-07-17)

Is it possible to pragmatically delete a matrix block based on its content? I have a channel called "Artist", which has a matrix field with concerts. It'll be about 5-600 concerts in total every year, so it's a bit of a hassle to manually remove old concerts. Every block has a field with the concert date. Is it possible to remove matrix blocks based on that date?

**Tags:** matrix
> **Comments:**
> **username_1**: I'm curious, why do you feel you need to delete the old content? Can't you just show events with relevant dates?  
> **username_2**: Instead of a matrix of concerts, you might have a channel of concerts, which could have an expiration date like other events.  
> **username_0**: @SteveRowling It will end up being a mess on the backend with 600 concerts in a year. It'll be near impossible to find anything after only a short while.  
> **username_0**: @MarionNewlevant The reason I can't have concerts as channels is because I'm using the free version, which only has one channel section. And it would still be a big mess with 600+ entries.  

---

## 0 answers

