Tours
Targeting
Control which pages load a tour so frontend assets stay off everywhere else.
Targeting decides whether a published tour is considered for the current request. Assets enqueue only when at least one tour matches (or is forced by a shortcode/block).
Rules
| Rule | Behavior |
|---|---|
all | Match every frontend page |
| Specific posts/pages | Match selected published post/page IDs |
| Post types | Match one or more post types |
| URL contains | Match when the request URL contains a substring |
Configure these in Tour Studio under Targeting. The studio loads published pages/posts from GET /wp-json/lcpt/v1/content-targets for the picker.
Forced matches
Shortcodes and the trigger block call the frontend to force a tour ID onto the page even if targeting would not match. That still loads assets only for pages that include the shortcode/block (or other matching tours).
Tips
- Prefer specific pages over
allfor production onboarding. - Use URL contains for query-driven flows (for example
welcome=1) when you do not want a hard post ID list. - Pro adds query-param and scroll triggers on top of these rules — see Pro.