Add event listings to WordPress with date, location and ticket link

Published 4 min read

Display plugins put posts in a grid. What they cannot add is an event date field. When event details end up pasted into titles or excerpts, sorting upcoming events by when they happen requires constant manual reordering. The archive shows stale events at the top, and there is no clean way to filter them out without deleting or unpublishing each one by hand.

The Events Calendar solves this end to end. It also ships with calendar views, recurring event logic, iCal exports, and a template layer that overrides the theme's single-event template. For a site with thirty concerts or eight quarterly meetups, most of that code runs doing nothing. The narrower plugin needed here registers one post type with four meta fields and a shortcode that returns only upcoming events.

Event data has fields that a grid plugin has nowhere to put

Grid display plugins determine how posts look on the page. They do not add fields to the post type. A grid plugin cannot add an event date input or a location field because those are properties of the post type, not the layout. Sites working around this end up with event dates in post titles ("Concert - Nov 15") or stored through a separate meta plugin whose values the grid plugin cannot read for ordering.

A custom post type solves this by defining the event date, time, location and ticket URL as meta fields from the start. The admin shows a meta box with four inputs on every event's edit screen. No separate plugin is needed to store the values, and no string parsing is needed to retrieve them.

Event date versus post date

WordPress stores a publication date in the posts table: the moment the post was saved or published. For a standard blog, that is the date the reader cares about. For events, the relevant date is when the event happens, which may be six months from now and has nothing to do with when the administrator added it. Sites that use the post publication date for ordering quickly find upcoming events scattered through the archive.

Storing the event start date as a custom meta value formatted as an eight-digit integer (20261115 for 15 November 2026) lets WordPress order events correctly. Setting orderby to meta_value_num treats those values as integers, which puts November before December without any date parsing. The same format makes the upcoming-only filter reliable: a greater-than-or-equal comparison in meta_query against today's date in that format returns only events that have not yet happened.

Past events drop off the archive automatically

The shortcode runs a WP_Query with two constraints: post status published, and event date meta on or after today. Each time the shortcode renders, today's date is recalculated. An event from last month stops appearing with no manual cleanup. The posts are not deleted; a past event's permalink still works, and searching for it still returns it. Only the shortcode-driven archive applies the date filter.

The default limit is 10 events. A limit attribute on the shortcode raises or lowers that number. For sites with a dense calendar, a second page can show older events by reversing the date comparison, but that is a separate query and not part of this build.

What you get

Included

  • Custom post type with meta box for event date, time, location and ticket URL
  • Featured image as the event poster, shown in the shortcode output
  • Upcoming-only shortcode that removes past events automatically as dates pass
  • Sortable admin column for event date in the post list screen

Not included

  • Recurring events, which require generating multiple occurrences from a date pattern
  • Calendar view, monthly navigation or iCal feed export
  • Event registration, seat limits or ticket sales
  • Per-category or location-based filtering in the archive
  • Front-end event submission from site visitors

The Events Calendar does the things on the right. This build covers the part most sites use.

Questions

If an event is today, when does it stop appearing in the upcoming list?

The comparison is against today's date in YYYYMMDD format, using WordPress's configured timezone. An event dated today stays visible for the whole day and drops off after midnight. If the transition happens at the wrong time, check that the timezone in Settings > General matches where most of your events are held.

Build it in Steem

The button opens the builder with this guide's prompt filled in, so you can change anything before it runs. Nothing is built, and nothing is charged, until you send it.

Build this pluginAbout 55 credits. The free plan includes enough for one.
Read the prompt (167 words)

Build a WordPress plugin called Simple Events. Register a custom post type called Event with a slug of event, support for a featured image, and a public archive. Add a meta box with four fields: Event Date (a date input, stored as an eight-digit number in YYYYMMDD format with no dashes), Event Time (a text field, for example 7:30pm), Location (a text field) and Ticket URL (a URL field). Add a sortable admin column for Event Date in the post list screen, showing the date in a human-readable format. Register a shortcode called events that queries published Event posts where the event date meta value is greater than or equal to today in YYYYMMDD format, ordered ascending by that meta field treated as a numeric value, with a default limit of 10 and an optional limit attribute. For each event, render the featured image, the linked post title, the formatted date and time, the location, and a Tickets link when the ticket URL field is not empty.