Event Genius uses a simple default single-event URL structure: /{event-slug}/{event-name}/ (for example /event/summer-party/). You can change the base segments under Events → Settings → General → Post Link Options. For more advanced structures, such as including the event start date in the path, developers can use filters and actions without modifying the plugin core.
When these hooks are unused, Event Genius keeps its default permalink behavior unchanged. There is no settings UI for custom structures in this release.
Available hooks
evge_event_permalink
Filter the generated URL for a single event. This runs for every call that builds an event permalink (calendars, emails, REST link fields, sitemaps that use get_permalink(), and so on).
apply_filters( 'evge_event_permalink', $post_link, $post, $leavename, $sample );- $post_link (string) — The current event permalink.
- $post (WP_Post) — The event post.
- $leavename (bool) — Whether WordPress should keep a
%postname%placeholder. - $sample (bool) — Whether this is a sample permalink in the editor.
evge_event_post_type_args
Filter the arguments passed to register_post_type() for evge_event. Use this when you need to adjust rewrite-related args (for example rewrite or with_front) at registration time.
apply_filters( 'evge_event_post_type_args', $args );evge_register_event_rewrite_rules
Action that fires after Event Genius registers its custom post types. Use it to add rewrite rules that match the URLs you generate with evge_event_permalink.
do_action( 'evge_register_event_rewrite_rules' );Event Genius does not automatically manage or flush custom rewrite rules. After you add or change rules, flush permalinks once (visit Settings → Permalinks and click Save, or call flush_rewrite_rules() from your own code in a controlled way).
Complete example: date-based event URLs
This example produces URLs like /event/2026/07/11/summer-party/ using the event start date stored in evge_start_date. Place the code in a small custom plugin or your theme’s functions.php.
/**
* Example: date-based Event Genius event permalinks.
*
* Resulting URL shape: /{event_slug}/YYYY/MM/DD/{post_name}/
*
* After activating, flush rewrite rules once:
* Settings → Permalinks → Save Changes.
*/
add_filter( 'evge_event_permalink', function( $permalink, $post, $leavename, $sample ) {
if ( ! $post instanceof WP_Post ) {
return $permalink;
}
$start = get_post_meta( $post->ID, 'evge_start_date', true );
if ( empty( $start ) ) {
return $permalink;
}
try {
$datetime = new DateTimeImmutable( $start );
} catch ( Exception $e ) {
return $permalink;
}
$base = class_exists( '\WPEventGenius\Common\Services\CptSlugService' )
? \WPEventGenius\Common\Services\CptSlugService::get_slug( 'event_slug' )
: 'event';
$name = $leavename ? '%postname%' : $post->post_name;
$path = sprintf(
'%s/%s/%s',
untrailingslashit( $base ),
$datetime->format( 'Y/m/d' ),
$name
);
return home_url( user_trailingslashit( $path ) );
}, 10, 4 );
add_action( 'evge_register_event_rewrite_rules', function() {
$base = class_exists( '\WPEventGenius\Common\Services\CptSlugService' )
? \WPEventGenius\Common\Services\CptSlugService::get_slug( 'event_slug' )
: 'event';
$base = trim( $base, '/' );
if ( '' === $base ) {
return;
}
add_rewrite_rule(
'^' . preg_quote( $base, '/' ) . '/([0-9]{4})/([0-9]{2})/([0-9]{2})/([^/]+)/?$',
'index.php?evge_event=$matches[4]',
'top'
);
} );Important caveats
- Matching rules are required. Changing the permalink filter without matching rewrite rules will produce 404s for those URLs.
- Existing links are not migrated. Old
/event/summer-party/URLs will not automatically redirect to a new structure. Add your own redirects if you need them. - Date changes. If you include the start date in the URL and later change the event date, previously shared links can break unless you add redirects.
- Archive slug collisions. Keep custom single-event paths distinct from the events archive base (default
/events/). - Recurring events. Each occurrence is its own event post with its own start date and
post_name. Date-based paths often work well here because occurrences can share a title while remaining unique by date. - Flush once after changes. After installing or updating custom rewrite code, save permalinks so WordPress stores the new rules.
Related settings
To change only the base URL segments (for example event → veranstaltungen), use Events → Settings → General → Post Link Options. That settings UI does not control date segments or other custom structures—use the hooks above for those.
If event pages return 404s after changing slugs or custom rules, see Fixing 404 Errors for Events, Venues, and Organizers.
Can't Find What You Need?
We're here to help with fast & friendly support