# How to change URL's used by sitemap.xml

**URL:** <https://forum.shopware.com/t/how-to-change-urls-used-by-sitemap-xml/57490>\
**Category:** International (English Only)\
**Tags:** programming\
**Created:** [15. Januar 2019 um 21:56 UTC](https://forum.shopware.com/t/how-to-change-urls-used-by-sitemap-xml/57490 "2019-01-15T21:56:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![genys](https://avatars.discourse-cdn.com/v4/letter/g/a183cd/32.png) [@genys](https://forum.shopware.com/u/genys)\
**Post date:** [15. Januar 2019 um 21:56 UTC](https://forum.shopware.com/t/how-to-change-urls-used-by-sitemap-xml/57490/1 "2019-01-15T21:56:27Z")

</div>

Right now, sitemap as I can see uses all links from the shop. Is there a way to set that sitemap only uses some of the links. For example, only categories. No articles etc. Just categories?

Thank you

---

<div class="post-metadata">

**Author:** ![odessite](https://avatars.discourse-cdn.com/v4/letter/o/f05b48/32.png) [@odessite](https://forum.shopware.com/u/odessite)\
**Post date:** [16. Januar 2019 um 10:26 UTC](https://forum.shopware.com/t/how-to-change-urls-used-by-sitemap-xml/57490/2 "2019-01-16T10:26:15Z")

</div>

```
**public static function** getSubscribedEvents() { **return** [_// xml_ **'Shopware\_Controllers\_Frontend\_SitemapXml::indexAction::after'** =\> **'onAfterSitemapContent'** , **'Shopware\_Controllers\_Frontend\_SitemapMobileXml::indexAction::after'** =\> **'onAfterSitemapContent'** , _// frontend_ **'Shopware\_Modules\_Sitemap\_indexAction'** =\> **'onSitemapIndexAction'** ,]; }

**public function** onSitemapIndexAction(\Enlight\_Event\_EventArgs $arguments) { $sitemap = $arguments-\>getReturn(); var\_dump($sitemap); // there you can see all links **unset** ($sitemap[1]); // for example there we will delete manufacturers link $arguments-\>setReturn($sitemap); **return** $arguments-\>getReturn(); }

```

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![genys](https://avatars.discourse-cdn.com/v4/letter/g/a183cd/32.png) [@genys](https://forum.shopware.com/u/genys)\
**Post date:** [16. Januar 2019 um 11:40 UTC](https://forum.shopware.com/t/how-to-change-urls-used-by-sitemap-xml/57490/3 "2019-01-16T11:40:21Z")

</div>

&nbsp;

> [@odessite schrieb:](https://forum.shopware.com/profile/24694/odessite "odessite")
> 
> **public static function** getSubscribedEvents() { **return** [_// xml_ **‚Shopware\_Controllers\_Frontend\_SitemapXml::indexAction::after‘** =\> **‚onAfterSitemapContent‘** , **‚Shopware\_Controllers\_Frontend\_SitemapMobileXml::indexAction::after‘** =\> **‚onAfterSitemapContent‘** , _// frontend_ **‚Shopware\_Modules\_Sitemap\_indexAction‘** =\> **‚onSitemapIndexAction‘** ,]; }
> 
> **public function** onSitemapIndexAction(\Enlight\_Event\_EventArgs $arguments) { $sitemap = $arguments-\>getReturn(); var\_dump($sitemap); // there you can see all links **unset** ($sitemap[1]); // for example there we will delete manufacturers link $arguments-\>setReturn($sitemap); **return** $arguments-\>getReturn(); }

&nbsp;I am not sure how this will effect url’s under sitemap.xml file?&nbsp; Since this is just a front controller, and url’s are generated with command sw:generate:sitemap

---

<div class="post-metadata">

**Author:** ![genys](https://avatars.discourse-cdn.com/v4/letter/g/a183cd/32.png) [@genys](https://forum.shopware.com/u/genys)\
**Post date:** [17. Januar 2019 um 14:39 UTC](https://forum.shopware.com/t/how-to-change-urls-used-by-sitemap-xml/57490/4 "2019-01-17T14:39:44Z")

</div>

I ended up creating plugin, and adding my own services for&nbsp;SitemapExporter

&nbsp;

---

<div class="post-metadata">

**Author:** ![odessite](https://avatars.discourse-cdn.com/v4/letter/o/f05b48/32.png) [@odessite](https://forum.shopware.com/u/odessite)\
**Post date:** [17. Januar 2019 um 21:57 UTC](https://forum.shopware.com/t/how-to-change-urls-used-by-sitemap-xml/57490/5 "2019-01-17T21:57:10Z")

</div>

I see, my comment related shopware till [version 5.5](https://developers.shopware.com/developers-guide/shopware-5-upgrade-guide-for-developers/#sitemap)…

Great that you found solution by yourself!

&nbsp;
