Magento 2 Sitemap
Magento 2 Sitemap Tutorial on How to Configure a Sitemap, where is the path and how to use in multistore.
Sitemaps » are basicaly the “Google Maps” of a site for the Google Search bot. Here we tell the bot were the pages are located, when they where last updated and how frequently we update each specific page.
Configuration #
- Login into the Admin Area.
- Hover over
Marketing
on the left side menu and underSEO & Search
, clickSite Map
. - In the
Site Map
Page click onAdd Sitemap
. - On the newly loaded page
New Site Map
specify:- Filename - Here enter the sitemap file: For example: sitemap.xml
- Path - you can use
/sitemap/
or/
- Store View
- Click on
Save and Generate
You will have to wait a few minutes depending on the size of your Product Catalog and CMS Pages, once the sitempa is ready
you will be redirected to the Site Map
page and the Sitemaps gird will show the newly added sitemap.
Settings #
Path #
The Path of the sitemap is a combitation of 2 inputs, Filename
+ Path
when you
Configure the sitemap in the backend.
https://www.example.com/<Path>/<Filename>
So if you have:
Filename
: sitemap.xmlPath
- /sitemap/
the URL of this sitemap will be https://www.example.com/sitemap/sitemap.xml.
Cron #
While there is no specific command to trigger only a sitemap generation you can still use the cron:run
command and specify
the default
group, as this one contains the sitemap_generate job:
$ bin/magento cron:run --group default
This will return if successful:
Ran jobs by schedule.
It is very important to have your Cron setup and running as any updates done to the Product Catalog, Categories or CMS Pages will be added to the Sitemap.xml automatically upon system cron run.
MultiStore #
In a multi-store Magento setup you can speicfy a sitemap for each store view. Steps from
Configure can
be followed for each store view, making sure at point 3 the Store View
is different and the Filename
is someting like
sitemap_us.xml
for a US store view.
Extension #
The extension to generate a Google Sitemap is present out-of-box and available for Configuration.
Errors #
Issues can popup when getting the sitemap or when accessing it. Some of the common issues found are bellow with possible fixes.
Not Generating #
This can happen if the Path
specified is not writable. To bypass this you can try and use the /media/
folder as that
is writable by default.
404 #
If you are getting a 404 make sure you are using the Link to Google
show in the Sitemaps
Page grid. If the 404 still
gets triggered make sure via FTP that the file is present in the filesystem and is not corrupted, you can download locally and
open in your browser.
Magento 2 Cache
Magento 2 Cache tutorial on different usage scenarios and why Cache should be enabled on your store.
ReadMagento 2 Maintenance
As a store owner you will need to block the access temporary for Customers in order to update CMS Page, Products or Updating Configuration. This is how you can do it.
ReadMagento 2 Varnish
Magento 2 Varnish. What is Varnish and how it can be used and configured in a Magento 2 store.
ReadMagento 2 Theme
Magento 2 Theme Tutorial, what is a theme and how can it be installed, configured or uninstalled in your store
ReadMagento 2 SEO
In this SEO guide we will help you get higher rankings by providing Magento 2 SEO Tips
ReadMagento 2 Indexer
Magento 2 Indexer, what is it and why is it needed in your Magento 2 store and how do you reindex.
Read