Choose All, First, Last, or a Specific Rule Occurrence

The Occurrences control decides which eligible match positions a Rule may change after QCDR has found and ordered the matches in the targeted rendered output. Available modes are All, First, Last, and A specific occurrence.

Occurrence Modes

  • All occurrences: selects every eligible match, subject to Rule and request-wide replacement ceilings.
  • First occurrence: selects the first eligible match in rendered-output order.
  • Last occurrence: selects the last eligible match.
  • A specific occurrence: selects the numbered occurrence you enter, using 1 for the first match, 2 for the second, and so on.

How QCDR Determines the Order

QCDR gathers eligible matches from the permitted output regions and sorts them by their position in the rendered response. The occurrence number therefore refers to runtime output order, not an article ID, DOM selector, database row, or source-file line.

When a Specific Number Does Not Exist

If you request occurrence 4 but only three eligible matches exist, QCDR selects nothing for that Rule on that request. It does not fall back to the last available match.

Protected and Targeted Output Changes the Count

Only eligible matches participate in occurrence selection. Page or extension targeting can remove entire output regions, and normally protected areas can remove matches before QCDR numbers the remaining occurrences. This is why the “second occurrence” on one page state may not be the second occurrence on another.

Test Repeated Content Carefully

  1. Keep the Rule Draft while defining the Find value and targeting.
  2. Count the intended rendered occurrences on a representative page.
  3. Select First, Last, or a specific number only when that position is stable for the page.
  4. Use Preview/Rule Health when available, then verify a normal frontend request before broad activation.

Community Discussion

Want to compare workflows, share practical tips, or discuss how you use this QCDR feature? Visit the QC Dynamic Replacer Community. For private support, bug reports, account-specific issues, or feature requests, use the QuantaCade support system.