Sitemaps
Last updated
Last updated
Advanced SEO generates sitemaps for all of your collections and taxonomies. The sitemaps are organized in a sitemap index, which can be accessed at /sitemap.xml
.
Sitemaps are generated on demand whenever a sitemap is visited on the front end. If you have a content-heavy site, this might take a lot of resources and, in some cases, even result in a timeout.
To combat this issue, you may generate the sitemaps with the following command:
Add the --queue
flag to generate the sitemaps in the background:
The recommended way to go about generating your sitemaps is to :
You may change the path where your generated sitemaps are saved in the config:
You may globally disable the sitemap feature by setting enabled
to false
in the config:
This will remove all the sitemap-related configs in the control panel and also remove the sitemap front end routes.
There are several ways to disable a collection or taxonomy from generating sitemaps.
Sitemaps won't be created for any collection or taxonomy that has been disabled in the config:
Sitemaps won't be created for any collection or taxonomy that has been configured to be excluded from the sitemap in the Indexing site defaults:
Sitemaps won't be created if Noindex
has been enabled in the Indexing site defaults:
A couple of factors determine whether an individual entry or term will be excluded from the sitemaps.
An entry or term will be excluded from the sitemap if the toggle is disabled:
An entry or term will be excluded from the sitemap if Noindex has been enabled:
An entry or term will be excluded from the sitemap if the canonical URL is anything else but Current Entry
or Current Term
. In the following example, the entry will be excluded from the sitemap:
Custom sitemaps are a great tool to add any Statamic or Laravel route to Advanced SEO's sitemaps.
Use the Sitemap::register()
method to register a custom sitemap in a service provider. The method expects a closure and needs to return a sitemap.
You also have the option to move the sitemap-related code into its own class.
The sitemap class needs to extend the BaseSitemap
and implement the urls()
method.