<p>You could have a look at Luke Peter's Sitemap solution. This is a script that generates your sitemap. You can modify it to fit your need and just output a list of URLs.</p>
<p><a href="https://lukepeters.me/blog/generate-an-xml-sitemap-in-craft-cms" rel="nofollow noreferrer">Generate an XML Sitemap in Craft CMS</a></p>
<pre><code>{# Create an empty array for all published entries #}
{% set entry_list = [] %}

{# Create a URI exclusion list for entries you don't want in the sitemap #}
{% set exclusions = [&quot;blog/unlisted-blog-post&quot;, &quot;thank-you-page&quot;] %}

{# Get all sections (singles, channels, and structures) #}
{% set sections = craft.app.sections.allSections %}

{# Loop through each section #}
{% for section in sections %}

  {# Get all entries of this section type, but only if they're published and have a URL #}
  {% set entries = craft.entries.sectionId(section.id).status(&quot;live&quot;).uri(&quot;not ''&quot;).all() %}

  {# Merge these entries into the main list #}
  {% set entry_list = entry_list|merge(entries) %}
  
{% endfor %}

{#
  Loop through all published entries to create the sitemap markup.
  Skip any entries with a URI that appears in the exclusions list.
#}
&lt;ul&gt;
{% for entry in entry_list if entry.uri not in exclusions %}
  &lt;li&gt;&lt;a href=&quot;{{ entry.url }}&quot;&gt;{{ entry.url }}&lt;/a&gt;&lt;/li&gt;
{% endfor %}
&lt;/ul&gt;
</code></pre>
<p>Most SEO Plugins that generate a Sitemap might solve this problem as well.</p>

CC BY-SA 4.0
2021-08-31T08:39:52.627Z
2021-08-31T08:39:52.627Z
Max Strebel
<p>We are currently evaluating different cookie consent solutions considering its price models and therefore we need to know the amount of &quot;active&quot; URLs in our Craft multisite installation.</p>
<p><strong>Does Craft somewhere cache or save complete URLs which I could count?</strong></p>
<p><em>(I'm not sure if it does but since Craft always makes sure that URLs are unique I have hope that it does.)</em></p>

CC BY-SA 4.0
2021-08-30T08:31:03.760Z
Without delving into the database, can't you just count how many URL-enabled elements you have, multiplied by the number of sites?
gioppe
CC BY-SA 4.0
2021-08-31T06:02:25.207Z
With Commerce and its product variants, not all entries available in all languages and so on, this might be inaccurate.
Matthias Redl-Mann
<url>
How many different URLs in a project
# How many different URLs in a project

(Asked by: username_0 on 2021-08-30)

We are currently evaluating different cookie consent solutions considering its price models and therefore we need to know the amount of "active" URLs in our Craft multisite installation.

**Does Craft somewhere cache or save complete URLs which I could count?**

*(I'm not sure if it does but since Craft always makes sure that URLs are unique I have hope that it does.)*

**Tags:** url
> **Comments:**
> **username_1**: Without delving into the database, can't you just count how many URL-enabled elements you have, multiplied by the number of sites?  
> **username_0**: With Commerce and its product variants, not all entries available in all languages and so on, this might be inaccurate.  

---

## 1 answers

### Answer by username_2 on 2021-08-31. Score: 1

You could have a look at Luke Peter's Sitemap solution. This is a script that generates your sitemap. You can modify it to fit your need and just output a list of URLs.
Generate an XML Sitemap in Craft CMS
{# Create an empty array for all published entries #}
{% set entry_list = [] %}

{# Create a URI exclusion list for entries you don't want in the sitemap #}
{% set exclusions = ["blog/unlisted-blog-post", "thank-you-page"] %}

{# Get all sections (singles, channels, and structures) #}
{% set sections = craft.app.sections.allSections %}

{# Loop through each section #}
{% for section in sections %}

  {# Get all entries of this section type, but only if they're published and have a URL #}
  {% set entries = craft.entries.sectionId(section.id).status("live").uri("not ''").all() %}

  {# Merge these entries into the main list #}
  {% set entry_list = entry_list|merge(entries) %}
  
{% endfor %}

{#
  Loop through all published entries to create the sitemap markup.
  Skip any entries with a URI that appears in the exclusions list.
#}

{% for entry in entry_list if entry.uri not in exclusions %}
  {{ entry.url }}
{% endfor %}


Most SEO Plugins that generate a Sitemap might solve this problem as well.


---

