Support

Home Forums Event Espresso Premium Expired Events Still Show Up in Global Search Results

Expired Events Still Show Up in Global Search Results

Posted: August 28, 2017 at 4:01 pm


jrengo

August 28, 2017 at 4:01 pm

Hi I’m using EE4 on my site and as well as a custom query to pull in events on my events listing page, which works fine and I am not seeing expired events here. However, when using my global search expired events still display in the search results. Can you explain why this might be and any potential solutions? Is there a way to unpublish an event once its expired so the url is no longer available to view?

I have the setting “Display Expired Events” set to “no”.

Thanks


fjorgeDigital

August 28, 2017 at 4:01 pm

Hi I’m using EE4 on my site and as well as a custom query to pull in events on my events listing page, which works fine and I am not seeing expired events here. However, when using my global search expired events still display in the search results. Can you explain why this might be and any potential solutions? Is there a way to unpublish an event once its expired so the url is no longer available to view?

I have the setting “Display Expired Events” set to “no”.

Thanks


Josh

  • Support Staff

August 29, 2017 at 11:21 am

That’s actually expected because WordPress search does not filter those queries, and expired events are not automatically unpublished because otherwise that could cause some SEO issues (404s).

You can remove the expired events by adding some code to your website:

https://gist.github.com/joshfeck/33a77ee2775e84658ff4955db5d5988e

You can add the above to a functions plugin or into your WordPress theme’s functions.php file.

You might also add the following to tell search engines to not index expired events:

https://gist.github.com/joshfeck/70979dc12f93ab25dd668ed4500be477

If you use the WordPress SEO plugin you can set the plugin to not include expired events in the generated sitemaps:

https://gist.github.com/joshfeck/85dcc9947b8f406093498464f542e990

The support post ‘Expired Events Still Show Up in Global Search Results’ 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.

Event Espresso