Skip to main content

Configuration Constants

A few Events Manager behaviors are set with PHP constants instead of options on a settings screen. Most exist for developers and for unusual sites, and most sites never need one.

How to set a constant​

  1. Open the wp-config.php file in the root folder of your WordPress site. Keep a copy before you edit it.

  2. Add a define() line above the line that reads /* That's all, stop editing! Happy publishing. */.

    wp-config.php
    define( 'EM_HIDE_ADDONS', true );
  3. Save the file. The change applies on the next page load.

To go back to the default, delete the line. Constants in this file apply to the whole installation, which on multisite means every site in the network.

Rows marked Pro need Events Manager Pro.

Display and front end​

ConstantDefaultWhat it does
EM_AJAX trueWhether lists load new pages of results without reloading the page. Set to false to make pagination links load a full page. An ajax attribute on a shortcode overrides it for that list.
EM_AJAX_SEARCH trueWhether the search form shows results without reloading the page. Set to false to have searches submit and load a new page.
EM_CONDITIONAL_RECURSIONS 2How many levels deep conditional placeholders can be nested.
EM_PAGES_TO_SHOW 11The most page numbers shown in the pagination links under a list.
EM_PAGINATION_CENTERED trueKeeps the current page number in the middle of the pagination links. Set to false to turn that off.
EM_CHECK_THE_LOOP not setSet to true if your theme shows event content in the wrong place, such as inside a menu or sidebar. Events Manager then replaces page content only inside the main WordPress loop.
EM_DISABLE_AUTO_BOOKINGSFORM not setSet to true to stop the booking form being added to event pages that don't use an Events Manager format. Place it yourself with #_BOOKINGFORM or the booking form block.
EM_JS_MOMENTJS_PH trueSet to false to switch off the #_EVENTDATES_LOCAL and #_EVENTTIMES_LOCAL placeholders, which load the Moment.js script. They then print nothing.
EM_BOOKING_MSG_JS_OFFSET 30After a booking is submitted the page scrolls to the confirmation or error message. This is the gap, in pixels, left above the message. Raise it if a fixed header covers the message.
EM_PHONE_INTL_ENABLED trueSet to false to remove the international phone number field (country picker and validation) and its settings. Phone fields become plain text fields.

Editing and admin​

ConstantDefaultWhat it does
EM_GUTENBERG not setForces the editor used for events and locations: true for the block editor, false for the classic editor. It overrides the Editor option in the settings. See the event editor.
EM_HIDE_ADDONS not setSet to true to hide the Events then Add-ons screen.
EM_CUSTOM_ARCHETYPES trueSet to false to switch off custom archetypes regardless of the settings.
EM_SETTINGS_TABS not setSet to true to open each tab of the settings screen as a separate page load. By default the tabs switch in the browser without reloading.
EM_UNFILTERED_HTML not setSet to true to let every administrator of the settings screen save unfiltered HTML in formats, including scripts. By default only users with WordPress's unfiltered_html capability can, which on multisite means super admins. Use it only where every settings user is fully trusted.
EM_BOOKINGS_TABLE_ATTENDEE_PREFIX trueColumn headings for attendee fields in the bookings table read "Attendee" followed by the field name. Set it to your own text containing %s, such as 'Guest %s', or to false to show the field name alone.
EM_AUTO_UPDATES not setWith Always check the latest stable version? on, Events Manager offers new releases before WordPress.org's staged rollout reaches your site, but leaves them for you to install by hand. Set this to true to let WordPress auto-update to those releases too. See Latest stable version.

Bookings​

ConstantDefaultWhat it does
EM_BOOKINGS_UNCANCEL_STATUS 0The status a booking returns to when a cancellation is undone and its earlier status wasn't recorded. 0 is Pending and 1 is Approved. Bookings cancelled in current versions remember their earlier status, so this matters only for older ones.
EM_BOOKING_HOLDS_BY_USER, EM_BOOKING_HOLDS_BY_IP 2How many space holds one logged-in user, or one IP address, can have at a time across all events. See Booking Holds.
EM_BOOKING_EVENT_HOLDS_BY_USER, EM_BOOKING_EVENT_HOLDS_BY_IP 1The same limits for a single event.

Exports and feeds​

ConstantDefaultWhat it does
EM_CSV_DELIMITER ,The column separator in CSV exports of bookings. Set it to ';' if your spreadsheet program opens exports as a single column.
EM_CSV_DISABLE_HEADERS not setSet to true to leave out the lines at the top of one event's bookings export that give the event name and location, so the file starts with the column headings.
EM_ICAL_TIMEZONE_SUPPORT trueSet to false to write times in iCal feeds without timezone information, for calendar programs that mishandle it.
EM_ICAL_APPLE_STRUCT not setSet to true to leave Apple's structured location line out of iCal feeds.

Performance​

ConstantDefaultWhat it does
EM_CALENDAR_OPT not setSet to true on sites with many thousands of events a month. The calendar then loads each day's events separately, up to the per-day limit, which uses less memory at the cost of more database queries.
EM_CACHE not setSet to false to stop Events Manager reading events from the WordPress object cache, when you suspect stale data. Set to true to tell Events Manager that pages are served by a page cache, as WordPress's own WP_CACHE does: the booking form then fetches fresh security tokens after the page loads.
EM_OPTIMIZE_SETTINGS_PAGE_USERS, EM_OPTIMIZE_SETTINGS_PAGE_LOCATIONS automaticThe settings screen replaces its drop-downs of users and locations with a field for an ID once there are more than 100 of either. Set to true to always use the ID field, or false to always show the drop-down.

Events Manager Pro​

ConstantDefaultWhat it does
EMP_DEV_UPDATES not setPro Set to true to receive development versions of Pro as updates. See Upgrading to a development version.
EMP_SHARED_CUSTOM_FIELDS not setPro By default the ID of a new custom user field is given a dbem_ prefix, so it can't clash with another plugin's user meta. Set to true to keep IDs as you type them, which lets a booking form field read and write a user meta key that another plugin also uses.
EMP_FORMS_TEXTAREA_SIZE not setPro The size of text area fields in booking forms, as rows and columns: '5,40'. The default is 2 rows and 20 columns.
EM_EMAIL_QUEUE truePro Set to false to stop the scheduled task that sends queued emails, such as event reminders. Queued emails are then not sent.
EM_QR_ENDPOINT em-qrPro The URL path used for ticket QR code images.
EM_FE_ENDPOINT_ALIAS not setPro An array of extra URL paths that also open the check-in screen. Add the old path here when you change the path in the settings, so QR codes already printed keep working.
EM_RSVP_ENDPOINT_ALIAS not setPro The same for the RSVP page, so links in emails already sent keep working after you change its path.
EM_RSVP_ID_LENGTH 8Pro The length of the code that identifies a booking in RSVP links.
EMP_DISABLE_WARNINGS not setPro Hides the admin notice shown when the installed Pro version is older than the free plugin recommends. Updating Pro is the better fix.
EMP_DISABLE_CRITICAL_WARNINGS not setPro When Pro is too old to run safely with the installed free plugin, Events Manager holds Pro back and shows a notice. Set to true to remove that safeguard. Not recommended.

Examples​

wp-config.php
// Let conditional placeholders nest three levels deep.
define( 'EM_CONDITIONAL_RECURSIONS', 3 );

// Export bookings with semicolons between columns.
define( 'EM_CSV_DELIMITER', ';' );

// Keep printed QR codes working after renaming the check-in path.
define( 'EM_FE_ENDPOINT_ALIAS', array( 'em-bookings' ) );