<p>This has been added in SEOmatic 3.1.36 as per <a href="https://twitter.com/nystudio107/status/1072260946276597767" rel="nofollow noreferrer">this release announcement tweet</a></p>

<p>You can do it via the GUI in <strong>SEOmatic</strong> -> <strong>Site Settings</strong> -> <strong>Sitemap</strong>: <a href="https://github.com/nystudio107/craft-seomatic#additional-sitemaps" rel="nofollow noreferrer">https://github.com/nystudio107/craft-seomatic#additional-sitemaps</a></p>

<p><a href="https://i.sstatic.net/3KMHd.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/3KMHd.png" alt="Additional Sitemaps"></a></p>

<p>...or you can do it via plugin:</p>

<pre><code>use nystudio107\seomatic\events\RegisterSitemapsEvent;
use nystudio107\seomatic\models\SitemapIndexTemplate;
use yii\base\Event;
Event::on(SitemapIndexTemplate::class, SitemapIndexTemplate::EVENT_REGISTER_SITEMAPS, function(RegisterSitemapsEvent $e) {
    $e-&gt;sitemaps[] = [
        'loc' =&gt; $url,
        'lastmod' =&gt; $lastMod,
    ];
});
</code></pre>

CC BY-SA 4.0
2018-12-11T23:44:48.357Z
No worries! Let me know how you go.
andrew.welch
CC BY-SA 4.0
2018-12-17T00:38:20.370Z
Your update works great. If I had to change anything I'd like to be able to include a {{SiteUrl}} variable (or similar) in the sitemap path.
Wayde Christie
CC BY-SA 4.0
2018-12-17T02:27:20.003Z
File a FR for it! https://github.com/nystudio107/craft-seomatic/issues -- should be easy to do
andrew.welch
CC BY-SA 4.0
2018-12-17T02:28:16.313Z
Also mark this as the accepted answer if you're satisfied with it, so SE can stay happy :)
andrew.welch
CC BY-SA 4.0
2018-12-10T22:48:34.513Z
2018-12-11T03:53:07.387Z
2018-12-11T03:53:07.387Z
andrew.welch
<p>This is actually pretty simple...</p>

<p>If you navigate to <strong>SEOmatic → Site Settings → Miscellaneous</strong>, you'll see a table at the bottom of the page where you can input custom sitemap urls.</p>

<p><a href="https://i.sstatic.net/nROZz.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/nROZz.png" alt="SEOmatic Miscellaneous Site Settings"></a></p>

<p>Once you add a url in here and save it, it will get added to a custom index sitemap that is included at the bottom of your main index sitemap:</p>

<p><strong>/sitemaps/1/sitemap.xml</strong></p>

<pre><code>&lt;sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"&gt;
  ...
  &lt;sitemap&gt;
    &lt;loc&gt; http://site.test/sitemaps/1/global/custom/1/sitemap.xml &lt;/loc&gt;
    &lt;lastmod&gt; 2018-11-16T10:06:31-05:00 &lt;/lastmod&gt;
  &lt;/sitemap&gt;
&lt;/sitemapindex&gt;
</code></pre>

<p><strong>/sitemaps/1/global/custom/1/sitemap.xml</strong></p>

<pre><code>&lt;urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"&gt;
  &lt;url&gt;
    &lt;loc&gt; http://site.test/custom.xml &lt;/loc&gt;
    &lt;lastmod&gt; 2018-12-07T14:26:25-05:00 &lt;/lastmod&gt;
    &lt;changefreq&gt; weekly &lt;/changefreq&gt;
    &lt;priority&gt; 0.5 &lt;/priority&gt;
  &lt;/url&gt;
&lt;/urlset&gt;
</code></pre>

<p>for more info → <a href="https://github.com/nystudio107/craft-seomatic#additional-sitemap-urls" rel="nofollow noreferrer">https://github.com/nystudio107/craft-seomatic#additional-sitemap-urls</a></p>

CC BY-SA 4.0
2018-12-07T22:13:09.817Z
You can also do it programmatically via PHP as well. Same link that Jalen mentioned.
andrew.welch
CC BY-SA 4.0
2018-12-09T22:40:22.840Z
Thanks Jalen - I did see this function but it looks like it only supports adding individual URLs - not other sitemaps. Ideally I want to add a new sitemap to the sitemapindex. I'm not sure whether Google will parse a sitemap.xml which is supplied as an individual URL rather than as part of a sitemapindex. Perhaps a feature request is in order :)
Wayde Christie
CC BY-SA 4.0
2018-12-10T16:05:54.483Z
Sorry, I misunderstood everything here... it looks like what you want is the ability to add additional sitemaps generated externally, and what SEOmatic lets you do is add URLs to _one_ additional `custom` sitemap. Yep, file a FR for this one @WaydeChristie
andrew.welch
CC BY-SA 4.0
2018-12-07T19:34:57.893Z
2018-12-07T19:34:57.893Z
Jalen Davenport
<p>I have a custom generated sitemap which I'd like to append to my SEOmatic sitemap.xml file.</p>

<p>Is this possible?</p>

<p>I suppose the simple alternative would be to just add an extra sitemap to Google Search Console?</p>

<plugin-seomatic>
Append custom sitemap to sitemap index
# Append custom sitemap to sitemap index

(Asked by: username_0 on 2018-12-07)

I have a custom generated sitemap which I'd like to append to my SEOmatic sitemap.xml file.

Is this possible?

I suppose the simple alternative would be to just add an extra sitemap to Google Search Console?

**Tags:** plugin-seomatic

---

## 2 answers

### Answer by username_1 on 2018-12-10. Score: 2 | Accepted answer

This has been added in SEOmatic 3.1.36 as per this release announcement tweet
You can do it via the GUI in SEOmatic -> Site Settings -> Sitemap: https://github.com/nystudio107/craft-seomatic#additional-sitemaps

...or you can do it via plugin:
use nystudio107\seomatic\events\RegisterSitemapsEvent;
use nystudio107\seomatic\models\SitemapIndexTemplate;
use yii\base\Event;
Event::on(SitemapIndexTemplate::class, SitemapIndexTemplate::EVENT_REGISTER_SITEMAPS, function(RegisterSitemapsEvent $e) {
    $e->sitemaps[] = [
        'loc' => $url,
        'lastmod' => $lastMod,
    ];
});

> **Comments:**
> **username_1**: No worries! Let me know how you go.  
> **username_0**: Your update works great. If I had to change anything I'd like to be able to include a {{SiteUrl}} variable (or similar) in the sitemap path.  
> **username_1**: File a FR for it! https://github.com/nystudio107/craft-seomatic/issues -- should be easy to do  
> **username_1**: Also mark this as the accepted answer if you're satisfied with it, so SE can stay happy :)  

---

### Answer by username_2 on 2018-12-07. Score: 2

This is actually pretty simple...
If you navigate to SEOmatic → Site Settings → Miscellaneous, you'll see a table at the bottom of the page where you can input custom sitemap urls.

Once you add a url in here and save it, it will get added to a custom index sitemap that is included at the bottom of your main index sitemap:
/sitemaps/1/sitemap.xml

  ...
  
     http://site.test/sitemaps/1/global/custom/1/sitemap.xml 
     2018-11-16T10:06:31-05:00 
  


/sitemaps/1/global/custom/1/sitemap.xml

  
     http://site.test/custom.xml 
     2018-12-07T14:26:25-05:00 
     weekly 
     0.5 
  


for more info → https://github.com/nystudio107/craft-seomatic#additional-sitemap-urls

> **Comments:**
> **username_1**: You can also do it programmatically via PHP as well. Same link that Jalen mentioned.  
> **username_0**: Thanks Jalen - I did see this function but it looks like it only supports adding individual URLs - not other sitemaps. Ideally I want to add a new sitemap to the sitemapindex. I'm not sure whether Google will parse a sitemap.xml which is supplied as an individual URL rather than as part of a sitemapindex. Perhaps a feature request is in order :)  
> **username_1**: Sorry, I misunderstood everything here... it looks like what you want is the ability to add additional sitemaps generated externally, and what SEOmatic lets you do is add URLs to _one_ additional `custom` sitemap. Yep, file a FR for this one @WaydeChristie  

---

