taxonomy - Expired event redirect to parent category

I build a website for a client of mine, that is going to continuously host events for his area.One of the requirements

I build a website for a client of mine, that is going to continuously host events for his area.

One of the requirements he has is to expire and remove from the database the events already completed.

The events will belong to categories.

The question is, how I could redirect with 301 the search engines and the visitors to the parent category of each event?

So let's say we have the categories theater and concert.

If I have an even for theater, and the event is expired + removed from the DB, how can I make the redirect to the theater category for all the upcoming visitors?

Any idea?


Update

What if I make a custom table to record the slugs of the events and the category IDs when an event is deleted, and then when I have a 404, to check the DB table for the requested slug and make a redirect using the category ID?

Could that solution be performant given that the site is going to host a few million of events?

I build a website for a client of mine, that is going to continuously host events for his area.

One of the requirements he has is to expire and remove from the database the events already completed.

The events will belong to categories.

The question is, how I could redirect with 301 the search engines and the visitors to the parent category of each event?

So let's say we have the categories theater and concert.

If I have an even for theater, and the event is expired + removed from the DB, how can I make the redirect to the theater category for all the upcoming visitors?

Any idea?


Update

What if I make a custom table to record the slugs of the events and the category IDs when an event is deleted, and then when I have a 404, to check the DB table for the requested slug and make a redirect using the category ID?

Could that solution be performant given that the site is going to host a few million of events?

Share Improve this question edited Jun 15, 2020 at 8:21 CommunityBot 1 asked Aug 2, 2019 at 8:38 KodeFor.MeKodeFor.Me 3052 gold badges3 silver badges17 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

Since I have less reputation I can't comment, this is not answered with code but wanted to help, you may check this plugin: https://wordpress/plugins/redirect-404-error-page-to-homepage-or-custom-page/ or just take required code from the plugin ( I am not connected with that plugin anyway )

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745276072a4620050.html

相关推荐

  • taxonomy - Expired event redirect to parent category

    I build a website for a client of mine, that is going to continuously host events for his area.One of the requirements

    21小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信