Excluding Events by Title, Location or general search

Whilst if is easy to include events by substrings in the option filter_title, filter_location and search e.g. filter_title=”Monday Coffee” there are times you may want to reverse the logic and exclude by substrings.

These three options do allow Regular Expressions ( regex) which is a powerful selection language, complex and esoteric.

However if you want to exclude a string you can follow this process.

Create and expression based on

^(?!The String you want to Exclude).*$

e.g. Morning Coffee

so you create
^(?!Monday Coffee).*$

Then you need to 'encode' this to make it safe to use in a shortcode - use the feature here  - encode a string

resulting in

%5E(%3F!Monday Coffee).*%24

Finally use it in your shortode e.g.

filter_title="%5E(%3F!Monday Coffee).*%24"


Was this helpful?