Home Forums Event Espresso Premium Shortcode To Filter by Status

Shortcode To Filter by Status

Posted: October 12, 2016 at 8:45 am


October 12, 2016 at 8:45 am

Is it possible to filter by category AND status? The category shortcode is working great but is shows both active and upcoming events but we only want to show upcoming (because active can no longer be registered for). Is this possible?


October 14, 2016 at 12:05 pm


I was given this suggestion:

Here is a sample code snippet that you can use in a site specific plugin (

It will remove expired events from the events listing view. This affects the default /events/ page along with the [ESPRESSO_EVENTS] shortcode.

However, I implemented this and I think the problem is that the list is showing both upcoming and active events. For us, events that are active can no longer be registered for and we therefore do not want them to show up in the list. Does anyone else have a suggestion on how we might be able to make this work properly?

Thanks so much!

Seth Shoultes

  • Support Staff

October 14, 2016 at 9:40 pm

Hi there,

I’ll need to ask one of our developers when they come back online Monday, if not over the weekend.


October 17, 2016 at 7:59 am

Thanks so much Seth! I really appreciate your help with this!


  • Support Staff

October 17, 2016 at 12:42 pm

Hi there,

The code snippet you linked to above (this one) actually filters out events where the tickets are no longer for sale. So if your active events have ticket sale end dates in the future, then the filter in that snippet will continue to show those events in the list.

So you can take one of these two approaches: a) You set the Ticket Sale end date to match or be before the date time start date or b) You add the following snippet to your site:


October 18, 2016 at 7:24 am

Thanks Josh! I inserted the code (both yours as well as the previous suggestion) and it doesn’t seem to work. I had inserted the list onto a page using the category shortcode. Do I need to modify the function to apply to all lists, event the category lists?


  • Support Staff

October 18, 2016 at 9:31 am

There is no need to modify the function, it applies to all lists, even the category lists. If you added the code to a plugin, did you activate the plugin?


October 21, 2016 at 6:00 am

I cannot believe it was that simple. Thanks Josh and I am sorry that it was something on my end! That fixed it and I am so so so excited that we got this working.


The support post ‘Shortcode To Filter by Status’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3 Documentation for Event Espresso 4

Status: closed

Updated by  NYSCDFI 3 years, 8 months ago ago

Topic Tags


This topic is: resolved
Do NOT follow this link or you will be banned from the site!