# Exclude aliases from sitemap.xml

**URL:** <https://forums.concretecms.org/t/exclude-aliases-from-sitemap-xml/5226>\
**Category:** Using Concrete / Help\
**Created:** [March 14, 2023, 9:28am UTC](https://forums.concretecms.org/t/exclude-aliases-from-sitemap-xml/5226 "2023-03-14T09:28:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![katalysis](https://forums.concretecms.org/user_avatar/forums.concretecms.org/katalysis/32/5562_2.png) [@katalysis](https://forums.concretecms.org/u/katalysis)\
**Post date:** [March 14, 2023, 9:28am UTC](https://forums.concretecms.org/t/exclude-aliases-from-sitemap-xml/5226/1 "2023-03-14T09:28:15Z")

</div>

I’m getting warnings in SEMrush for a site that uses aliases to duplicate content into different categories.

Canonical URLs are set correctly with alias pages listing their source pages as canonical. However the aliases are still included in the sitemap.xml file which SEMRush (and other SEO tools) see as incorrect.

There doesn’t seem to be a way to add an ‘Exclude from Sitemap’ attribute to an alias or any other way to exlude aliases from the sitemap. Am I missing something here?

---

<div class="post-metadata">

**Author:** ![JohntheFish](https://forums.concretecms.org/user_avatar/forums.concretecms.org/johnthefish/32/3767_2.png) [@JohntheFish](https://forums.concretecms.org/u/JohntheFish)\
**Post date:** [March 14, 2023, 11:37am UTC](https://forums.concretecms.org/t/exclude-aliases-from-sitemap-xml/5226/2 "2023-03-14T11:37:42Z")

</div>

I have a vague memory of an issue from way back where the developer was asking for aliases to be included in the sitemap.

---

<div class="post-metadata">

**Author:** ![katalysis](https://forums.concretecms.org/user_avatar/forums.concretecms.org/katalysis/32/5562_2.png) [@katalysis](https://forums.concretecms.org/u/katalysis)\
**Post date:** [March 14, 2023, 3:15pm UTC](https://forums.concretecms.org/t/exclude-aliases-from-sitemap-xml/5226/3 "2023-03-14T15:15:22Z")

</div>

@JohntheFish I found this on github about including aliases in search results: [Include page aliases in page search result by HamedDarragi · Pull Request #8021 · concretecms/concretecms · GitHub](https://github.com/concretecms/concretecms/pull/8021)

I can see the use case for this. The SEO advice I’m finding says best practice is only to include canonical URLs in xml sitemaps. Although I cannot find anything definitive from Google.

I had an idea that there may have been a way to add an attribute to an alias but I think I am mistaken.

---

<div class="post-metadata">

**Author:** ![JohntheFish](https://forums.concretecms.org/user_avatar/forums.concretecms.org/johnthefish/32/3767_2.png) [@JohntheFish](https://forums.concretecms.org/u/JohntheFish)\
**Post date:** [March 14, 2023, 3:22pm UTC](https://forums.concretecms.org/t/exclude-aliases-from-sitemap-xml/5226/4 "2023-03-14T15:22:15Z")

</div>

That should identify where to change the core back again :-).

Ideally, to create a new pull request to use a config value ‘exclude\_aliases’ to switch the new behaviour off again. Maybe a better pull would be a v9 Task parameter for the sitemap task to ‘Exclude Aliases’.

Either way, including aliases will need to be the default as that is the ‘current’ core behaviour.

---

<div class="post-metadata">

**Author:** ![katalysis](https://forums.concretecms.org/user_avatar/forums.concretecms.org/katalysis/32/5562_2.png) [@katalysis](https://forums.concretecms.org/u/katalysis)\
**Post date:** [March 14, 2023, 6:07pm UTC](https://forums.concretecms.org/t/exclude-aliases-from-sitemap-xml/5226/5 "2023-03-14T18:07:44Z")

</div>

Thanks @JohntheFish I’ve made an issue for this now:

> <https://github.com/concretecms/concretecms/issues/11298>
>
> \### Affected Version of Concrete CMS
> 
> 9.x
> 
> \### Description
> 
> When the sitemap.xml… file is generated the urls of alias pages are included but should not be.
> 
> This behaviour gives errors in search optimisation services like SEMRush, ahrefs etc. Various SEO articles advise not to include non-canonical URLs which are also likely to cause duplicate content issues in Google Search console.
> 
> \### How to reproduce
> 
> Create an alias of a page and inspect the sitemap.xml output.
> !\[sitemap-alias\](https://user-images.githubusercontent.com/4235012/225097249-0157b8e7-be3e-48ee-8220-12a5c3d86012.png)
> 
> 
> \### Possible Solution
> 
> Maybe a v9 Task parameter for the sitemap task to ‘Exclude Aliases’ (thank you @JohntheFish for the suggestion)
> 
> \### Additional Context
> 
> \_No response\_
