Home Forums Backend Issues (wp-admin) How to hide past events in WordPress admin screen


How to hide past events in WordPress admin screen

  • Hi
    I have an events custom post type and I’m trying to hide past events in the WordPress admin screen. I’ve looked all over but everything I’ve found only relates to the front end.

    Can anyone point me in the right direction?


  • I didn’t see what this has to do with ACF.

    And why do you want to hide these post on the admin screen. If you hide them, how to get access to them?

  • @alryalls did you ever arrive at a solution to this?

    And to Thomas, the ACF is controlling, I assume, the Event Date and the answer to your question is it will need to be toggled.

  • @tmconnect is correct, this is not really an ACF question even if the field you want to filter posts by is an acf field. But here is an overview of how to do this.

    You need to add a pre_get_post filter to WP, check that the query is being done:

    1. In the admin is_admin()
    2. hat the query is the main query $query->is_main_query()
    3. The the query is being done on your post type, here you need to check the $query->query array to see what is being queried
Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘How to hide past events in WordPress admin screen’ is closed to new replies.