<p>You would do that using an ElementCriteriaModel:</p>

<pre class="lang-php prettyprint-override"><code>$criteria = craft()-&gt;elements-&gt;getCriteria(ElementType::Entry);
$criteria-&gt;section = 'mySectionHandle';
$criteria-&gt;limit = null;

$entries = $criteria-&gt;find();
</code></pre>

<p>You can read all about how to work with ElementCriteriaModel’s in the <a href="http://buildwithcraft.com/docs/plugins/working-with-elements">Working with Elements</a> guide in the Craft docs.</p>

CC BY-SA 3.0
2014-06-30T14:32:05.140Z
2014-06-30T14:33:54.547Z
2014-06-30T14:33:54.547Z
Brandon Kelly
<p>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.</p>

<plugin-development>
Get all entries from a channel
# Get all entries from a channel

(Asked by: username_0 on 2014-06-30)

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.

**Tags:** plugin-development

---

## 1 answers

### Answer by username_1 on 2014-06-30. Score: 12 | Accepted answer

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.


---

