Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any known way to get all the entries from a certain channel? I dont want to do this in a view but in PHP since i need to do a bulk update of an attribute to all the entries in a certain channel.

share|improve this question
up vote 9 down vote accepted

You would do that using an ElementCriteriaModel:

$criteria = craft()->elements->getCriteria(ElementType::Entry);
$criteria->section = 'mySectionHandle';
$criteria->limit = null;

$entries = $criteria->find();

You can read all about how to work with ElementCriteriaModel’s in the Working with Elements guide in the Craft docs.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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