<p>There is no event for this and it would not be possible via event since no one is executing any scripts. Unless there is a request there is no way for PHP to execute code on its own so you need to create a cronjob or a Craft task and execute your functions when someone visits the site.</p>

<p>I would create a cronjob that executes hourly and search for expired entries in order to find them. You can store a value in a field that is not in the layout of the model to mark it as "handled" </p>

CC BY-SA 4.0
2018-07-18T19:54:50.737Z
2018-07-18T19:54:50.737Z
Robin Schambach
<p>I would like to update an entry after it has expired via a plugin. Is there an event that I can use to do this when using Craft 2? </p>

<plugin-development><events><expiration><expired>
Is there an event that is triggered when an entry expires?
# Is there an event that is triggered when an entry expires?

(Asked by: username_0 on 2018-07-18)

I would like to update an entry after it has expired via a plugin. Is there an event that I can use to do this when using Craft 2?

**Tags:** plugin-development, events, expiration, expired

---

## 1 answers

### Answer by username_1 on 2018-07-18. Score: 1

There is no event for this and it would not be possible via event since no one is executing any scripts. Unless there is a request there is no way for PHP to execute code on its own so you need to create a cronjob or a Craft task and execute your functions when someone visits the site.

I would create a cronjob that executes hourly and search for expired entries in order to find them. You can store a value in a field that is not in the layout of the model to mark it as "handled"


---

