# Expired requests not expiring

**URL:** <https://community.hivepress.io/t/expired-requests-not-expiring/16885>\
**Category:** Requests\
**Created:** [October 13, 2025, 2:06am UTC](https://community.hivepress.io/t/expired-requests-not-expiring/16885 "2025-10-13T02:06:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PrimalDee](https://community.hivepress.io/user_avatar/community.hivepress.io/primaldee/32/10446_2.png) [@PrimalDee](https://community.hivepress.io/u/PrimalDee)\
**Post date:** [October 13, 2025, 2:06am UTC](https://community.hivepress.io/t/expired-requests-not-expiring/16885/1 "2025-10-13T02:06:08Z")

</div>

Hi  
I was previously given this code by your team, to expire events based on attribute event\_date.

It doesn’t work and hoping for an update / help on what is wrong with it please.

I should add: When I say it doesn’t work, I mean that the requests can still have offers submitted and approved. It looks and behaves like a ‘normal’ request.

Thanks

```auto
add_action(‘hivepress/v1/models/request/update’,
function( $request_id, $request ) {
   if ( $request->get_event_date() ) {
       update_post_meta($request_id, ‘hp_expired_time’, strtotime($request->get_event_date()));
       }
   }, 10, 2);

```

---

<div class="post-metadata">

**Author:** ![kseniia](https://community.hivepress.io/user_avatar/community.hivepress.io/kseniia/32/13513_2.png) [@kseniia](https://community.hivepress.io/u/kseniia)\
**Post date:** [October 13, 2025, 2:33pm UTC](https://community.hivepress.io/t/expired-requests-not-expiring/16885/4 "2025-10-13T14:33:55Z")

</div>

Hi,

Please make sure that you add the snippet correctly: [How to add custom code snippets - HivePress Help Center](https://help.hivepress.io/article/23-how-to-add-custom-code-snippets). Additionally, make sure that the custom attribute has `event_date` name, if the field name is different, please replace it with the correct one.

To test if it works, please create a request with a past date, then go to the request on the backend and verify that the expiration date in the request is set. If so, the request will change status to Draft within a few hours.

Also, please note that this snippet works for requests, not listings. If you use it for listings, please change all request entities to listing in the code.

Hope this helps.

P.S. Please note that we have to move this topic to the Requests forum category. Since it’s related to a premium extension, the forum category is restricted — please add the license key to the account settings or consider renewing support if you still need assistance related to the premium themes or extensions [Renew Support | HivePress  
 ](https://hivepress.io/renew-support)

---

<div class="post-metadata">

**Author:** ![system](https://community.hivepress.io/user_avatar/community.hivepress.io/system/32/13990_2.png) [@system](https://community.hivepress.io/u/system)\
**Post date:** [November 12, 2025, 2:35pm UTC](https://community.hivepress.io/t/expired-requests-not-expiring/16885/6 "2025-11-12T14:35:13Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
