Does ExpressionEngine support the "break" functionality in its loops?

{exp:channel entries
  {if some_arbitrary_condition}
    {!-- Do Break(exit the loop) --}
{/exp:channel entries}

2 Answers 2


I found out that there is no break functionality for Expression Engine as of now.

The closest thing that can emulate it is using this code

{if count == "1"}
…output count here…

It would still do the conditional for each iteration but you only execute the code inside once.

Thanks to @Bhaskar Yadav for the link


I think Mark Croxton's Switchee plugin might do what you're looking for, but not in that syntax. It'll let you create multiple case statements and also accepts regex patterns.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.