Site maps
A site map improves the way that your store is indexed by search engines, and is designed to find pages that might be overlooked by web crawlers. A site map can be configured to index all pages and images.
When enabled, Commerce creates a file called sitemap.xml
that is saved to your installation in the location that you specify. The configuration gives you the ability to set the frequency of the updates, and the priority for each type of content. Your site map should be updated as frequently as the content on your site changes, which might be daily, weekly, or monthly.
While your site is in development, you might include instructions in the robots.txt
file for web crawlers to avoid indexing the site. Then before the launch, you can change the instructions to allow the site to be indexed.
For technical information, see Add sitemap and robots.txt in the Commerce on Cloud Infrastructure Guide.
Step 1. Configure the site map
Complete the XML Sitemap configuration to determine what is included, and how frequently the site map is updated.
Step 2. Generate the site map
-
On the Admin menu, go to Marketing > SEO & Search > Site Map.
-
Click Add Site Map.
{width="700" modal="regular"}
-
Enter the site map Filename. For example:
sitemap.xml
-
Enter the Path to determine where the site map file is to reside on the server. Make sure that the path is writeable.
-
/sitemap/
- Places the site map file in a directory called sitemap. -
/
- Places the site map file at the base path, or root of your Commerce installation.
{width="600" modal="regular"}
-
-
When complete, click Save & Generate.
It might take a few minutes for the site map to appear in the grid.
Step 3. Configure and enable robots.txt (optional)
Complete the search engine robots configuration with instructions that direct search engines to crawl the parts of your site that you want to be indexed.
Step 4. Submit your site map to search engines
You can submit your site map to different search engines by providing them the link to the sitemap.xml
file in your Commerce installation. To copy the link, do the following:
-
In the Site Map list, right-click the URL in the Link for Google column.
-
On the menu, choose Copy Link Address.
For more information, see the instructions for the specific search engine. Here are links to instructions for two top search engines:
Step 5: Restore previous robot instructions (optional)
You can now restore either the original (default) restrictions.
Manage sitemaps and robots.txt for multiple websites
If you have multiple websites, you can simplify the process of creating and submitting sitemaps. Simply create one or more sitemaps that include URLs for all your verified stores and save the sitemaps to a single location. All sites must be verified in Google Search Console.
To create sitemaps for a multistore instance, do the following:
-
Create a folder called
sitemaps
at the root of your website, then create subfolders for each domain:code language-none /sitemaps/domain_1/ /sitemaps/domain_2/
-
On the Admin sidebar, go to Marketing > SEO & Search > Site Map.
-
Create or edit the sitemap listings for each store and set the Path to the one you created for the store:
/sitemaps/domain_1/
/sitemaps/domain_2/
-
If needed, update your robots.txt file.
To make sure that the search engine spiders are properly directed to the new sitemaps, you can update or create the robots.txt file. Add the following lines at the top.
code language-none Website Sitemap Sitemap: https://www.domain_1.com/sitemaps/domain_1/sitemap.xml Sitemap: https://www.domain_2.com/sitemaps/domain_2/sitemap.xml
Column descriptions
/sitemap/
- Places the site map file in a directory called sitemap, one level below the root of the Commerce installation./
- Places the site map file at the base path, or root of the Commerce installation.Site map configuration
Your site map should be updated as frequently as the content on your site changes, which could be on a daily, weekly, or monthly basis. The configuration lets you set the frequency and priority for each type of content.
Step 1. Set the frequency and priority of content updates
-
On the Admin sidebar, go to Stores > Settings > Configuration.
-
In the left panel, expand Catalog and choose XML Sitemap.
-
Expand the Categories Options section and do the following:
note note NOTE If needed, clear the Use system value checkbox to change these settings. -
Set Frequency to one of the following:
Always
Hourly
Daily
Weekly
Monthly
Yearly
Never
-
For Priority, enter a value between
0.0
and1.0
. Zero has the lowest priority.
{width="600" modal="regular"}
For a detailed list of these options, see Categories Options in the Configuration Reference.
-
-
Expand the Products Options section and complete the Frequency and Priority settings as needed.
For a detailed list of these options, see Products Options in the Configuration Reference.
-
To determine the extent that images are included in the sitemap, set Add Images into Sitemap to one of the following:
None
Base Only
All
{width="600" modal="regular"}
-
Expand the CMS Pages Options section and complete the Frequency and Priority settings as needed.
{width="600" modal="regular"}
For a detailed list of these options, see CMS Pages Options in the Configuration Reference.
-
Expand the Store Url Options section and complete the Frequency and Priority settings as needed.
{width="600" modal="regular"}
For a detailed list of these options, see Store Url Options in the Configuration Reference.
-
When complete, click Save Config.
Step 2. Complete the generation settings
-
Expand the Generation Settings section.
If needed, clear the Use system value checkbox to change these settings.
{width="600" modal="regular"}
For a detailed list of these options, see Generation Settings in the Configuration Reference.
-
To generate a sitemap, set Enabled to
Yes
and do the following:-
Set Start Time to the hour, minute, and second that you want the sitemap to be updated.
-
Set Frequency to one of the following:
Daily
Weekly
Monthly
-
For Error Email Recipient, enter the email address of the person who is to receive notification if an error occurs during a sitemap update.
-
Set Error Email Sender to the store contact who appears as the sender of the error notification.
-
Set Error Email Template to the template used for the error notification.
-
Step 3. Set the site map file limits
-
Expand the Sitemap File Limits section.
{width="600" modal="regular"}
For a detailed list of these options, see Sitemap File Limits in the Configuration Reference.
-
For Maximum No of URLs per File, enter the maximum number of URLs that can be included in the sitemap.
By default, the limit is 50,000.
-
For Maximum File Size, enter the largest size in bytes that is allocated for the sitemap.
The default size is 10,485,760 bytes.
Step 4. Set the search engine submission settings
-
Expand the Search Engine Submission Settings section.
{width="600" modal="regular"}
-
If using a
robots.txt
file to provide instructions to search engines that crawl your site, set Enable Submission to Robots.txt toYes
. -
When complete, click Save Config.