Search code examples
typo3typo3-extensionstypo3-10.x

TYPO3: modify root page of sitemap in plugin tx_seo


I successfully configured the sitemap of my TYPO3 v10 project within the plugin SEO and added custom configurations in my templatesetup.ts with the official TYPO3 docs:

plugin.tx_seo {
  config {
    xmlSitemap {
      sitemaps {
        pages {
          provider = TYPO3\CMS\Seo\XmlSitemap\PagesXmlSitemapDataProvider
          config {
            excludedDoktypes = 3, 4, 6, 7, 199, 254, 255
            additionalWhere = no_index = 0
          }
        }
      }
    } 
  }
}

Here you can see a few lines of my sitemap.xml:

cutout of my sitemap.xml

My goal is, to remove all the lines with just the root "/". How can I set another rootId for my sitemap.xml other than 1?

Thanks for your help.


Solution

  • You need the parameter rootPage. Unfortunately it's undocumented (yet).

    So your TypoScript should look like this:

    plugin.tx_seo {
      config {
        xmlSitemap {
          sitemaps {
            pages {
              provider = TYPO3\CMS\Seo\XmlSitemap\PagesXmlSitemapDataProvider
              config {
                excludedDoktypes = 3, 4, 6, 7, 199, 254, 255
                additionalWhere = no_index = 0
                rootPage = 135
              }
            }
          }
        } 
      }
    }