<p>Just add the locale criteria to your entries call and specify the locale(s) you need to query. </p>

<pre><code>{% set items = craft.entries({
    section: 'sectionHandle',
    limit: null,
    locale:"es_us"
}) %}
</code></pre>

CC BY-SA 3.0
2017-04-19T16:05:59.527Z
2017-04-19T16:05:59.527Z
a-am
<p>I am trying to build a sitemap and need to loop through all entries in Craft in order to do this. </p>

<p>However, I am building a multi language site which has entries that can be enabled in a single locale but not in others. Because my default language (English) doesn't have a language code in it's site url (i.e. mysite.com is the English index and mysite.com/ja is the Japanese index), the sitemap template I am using automatically assumes the current locale to be English and <strong>any entry that is not enabled in English (but is enabled in another locale) does not get included in the sitemap loop</strong>.</p>

<p>Is there any way I can still include entries that are not enabled in the current locale (English) but are enabled in an alternate locale? Or is there some better way I should be doing this?</p>

<localization><seo>
How can I loop through all entries that are enabled in at least one locale (not necessarily my current locale)?
# How can I loop through all entries that are enabled in at least one locale (not necessarily my current locale)?

(Asked by: username_0 on 2017-04-19)

I am trying to build a sitemap and need to loop through all entries in Craft in order to do this.

However, I am building a multi language site which has entries that can be enabled in a single locale but not in others. Because my default language (English) doesn't have a language code in it's site url (i.e. mysite.com is the English index and mysite.com/ja is the Japanese index), the sitemap template I am using automatically assumes the current locale to be English and **any entry that is not enabled in English (but is enabled in another locale) does not get included in the sitemap loop**.

Is there any way I can still include entries that are not enabled in the current locale (English) but are enabled in an alternate locale? Or is there some better way I should be doing this?

**Tags:** localization, seo


---

## 1 answers

### Answer by username_1 on 2017-04-19. Score: 1

Just add the locale criteria to your entries call and specify the locale(s) you need to query. 
{% set items = craft.entries({
    section: 'sectionHandle',
    limit: null,
    locale:"es_us"
}) %}


---

