<p>I don't know what version of Craft you're using, but recently it became possible to request multiple site's version of the same entry/entries. For this to work, you need to provide multiple site ID's to the <code>siteId</code> part of the query, or multiple handles to the <code>site</code> part of the query:</p>

<pre><code>{#
 # Provide the entry element query with the IDs for 3 sites
 # and group those by the entry's ID, so we know which entries belong together
 #}
{% set entriesById = craft.entries.siteId([1,2,3]).all() |group('id') %}

{#
 # Loop through the grouped entries and display whatever you need to display.
 # Each entry has their own `siteId` set, so you can use .getUrl() (or .url) to display the url
 #} 
{% for entryId, entries in entriesById %}
    &lt;h2&gt;Entry {{ entryId }}&lt;/h2&gt;

    {% for entry in entries %}
        URL: {{ entry.url }} - Status: {{ entry.status }}  
    {% endfor %}
{% endfor %}
</code></pre>

<p>If you are using Craft 2 (or a Craft 3 version before it became possible to query multiple site's entry versions at once), I think you could do it like this:</p>

<pre><code>{# Craft 2 (untested, it's been a while ... #}
{% for locale in craft.i18n.getSiteLocales() %}
    {% set entry = craft.entries.id([your entry's id]).locale(locale) %}

    {% if entry %}
        URL: {{ entry.url }} - Status: {{ entry.status }}
    {% endif %}
{% endfor %}

{# Craft 3, before my original answer became possible #}
{% for site in craft.app.sites.allSites %}
    {% set entry = craft.entries.id([your entry's ID]).siteId(site.id).one() %}

    {% if entry %}
        URL: {{ entry.url }} - Status: {{ entry.status }}
    {% endif %}
{% endfor %}
</code></pre>

CC BY-SA 4.0
2020-02-17T08:25:25.080Z
I'm currently using craft 2.
Nelson Nguyen
CC BY-SA 4.0
2020-02-17T08:26:23.877Z
Ah. I'll see if I can add a Craft 2 example to the answer :)
Paul
CC BY-SA 4.0
2020-02-17T08:27:52.477Z
Thank. You're saving me
Nelson Nguyen
CC BY-SA 4.0
2020-02-17T09:16:17.077Z
Unfortunately, getSiteLocales only show one site.
Nelson Nguyen
CC BY-SA 4.0
2020-02-17T08:20:01.073Z
2020-02-17T08:35:39.380Z
2020-02-17T08:35:39.380Z
Paul
<p>I have an multisite installation like this:</p>

<ul>
<li>www.example.com/animal</li>
<li>www.example.uk/animal</li>
</ul>

<p>Each site has a configuration like so:</p>

<pre><code>'example.com' =&gt; array(
        'siteUrl' =&gt; array(
            'us_en' =&gt; 'https://www.example.com/'
        )
'example.uk' =&gt; array(
        'siteUrl' =&gt; array(
            'uk_en' =&gt; 'https://www.example.uk/'
        ).
</code></pre>

<p>I want to print a collection of URLs from all of the locales. For example:</p>

<ul>
<li>www.example.com/animal</li>
<li>www.example.uk/animal</li>
</ul>

<p>And check their status as well.</p>

<localization>
Get all URLs from a multisite installation
# Get all URLs from a multisite installation

(Asked by: username_0 on 2020-02-17)

I have an multisite installation like this:

www.example.com/animal
www.example.uk/animal

Each site has a configuration like so:
'example.com' => array(
        'siteUrl' => array(
            'us_en' => 'https://www.example.com/'
        )
'example.uk' => array(
        'siteUrl' => array(
            'uk_en' => 'https://www.example.uk/'
        ).

I want to print a collection of URLs from all of the locales. For example:

www.example.com/animal
www.example.uk/animal

And check their status as well.

**Tags:** localization

---

## 1 answers

### Answer by username_1 on 2020-02-17. Score: 2

I don't know what version of Craft you're using, but recently it became possible to request multiple site's version of the same entry/entries. For this to work, you need to provide multiple site ID's to the siteId part of the query, or multiple handles to the site part of the query:
{#
 # Provide the entry element query with the IDs for 3 sites
 # and group those by the entry's ID, so we know which entries belong together
 #}
{% set entriesById = craft.entries.siteId([1,2,3]).all() |group('id') %}

{#
 # Loop through the grouped entries and display whatever you need to display.
 # Each entry has their own `siteId` set, so you can use .getUrl() (or .url) to display the url
 #} 
{% for entryId, entries in entriesById %}
    Entry {{ entryId }}

    {% for entry in entries %}
        URL: {{ entry.url }} - Status: {{ entry.status }}  
    {% endfor %}
{% endfor %}

If you are using Craft 2 (or a Craft 3 version before it became possible to query multiple site's entry versions at once), I think you could do it like this:
{# Craft 2 (untested, it's been a while ... #}
{% for locale in craft.i18n.getSiteLocales() %}
    {% set entry = craft.entries.id([your entry's id]).locale(locale) %}

    {% if entry %}
        URL: {{ entry.url }} - Status: {{ entry.status }}
    {% endif %}
{% endfor %}

{# Craft 3, before my original answer became possible #}
{% for site in craft.app.sites.allSites %}
    {% set entry = craft.entries.id([your entry's ID]).siteId(site.id).one() %}

    {% if entry %}
        URL: {{ entry.url }} - Status: {{ entry.status }}
    {% endif %}
{% endfor %}

> **Comments:**
> **username_0**: I'm currently using craft 2.  
> **username_1**: Ah. I'll see if I can add a Craft 2 example to the answer :)  
> **username_0**: Thank. You're saving me  
> **username_0**: Unfortunately, getSiteLocales only show one site.  

---

