To configure Magento 2 Blog XML sitemap please, first of all, make sure that Magento default XML sitemap has been configured properly.
Once you have configured Magento XML sitemap for products, categories, CMS pages, blog sitemap will be generated automatically and will be available by the same path as your default XML sitemap but with "blog_" prefix.
Example 1
Default XML Sitemap URL: https://domain.com/sitemap.xml
Blog XML Sitemap URL: https://domain.com/blog_sitemap.xml
Example 2
Default XML Sitemap URL: https://domain.com/pub/en_sitemap.xml
Blog XML Sitemap URL: https://domain.com/pub/blog_en_sitemap.xml
Note that you will not see any additional sitemap item in the sitemap grid in the admin panel. Blog sitemap XML will be generated automatically in the background together with the regular sitemap and you will have to submit it to Google as well.
Once a blog sitemap is generated we strongly recommend adding its link to the robots.txt as it is done at Magefan (https://magefan.com/robots.txt).
Check the robots.txt file configuration guide to learn more about what robots.txt file actually is and find the examples.
If you use Blog Plus or Blog Extra editions of the Blog extension you are able to change the priority and frequency of the blog items in the XML sitemap.
In order to do this please go to Stores > Configuration > Blog and find the XML Sitemap section. Here you can manage the frequency and priority of the Blog Index Page, Blog Categories and Blog Posts.
Blog XML Sitemap Troubleshooting
1. Why blog_sitemap.xml is missing in my Magento 2?
- Please make sure that you use the latest version of the blog extension. Check the extension change log to see if there are any sitemap bug fixes or improvements.
2. My blog sitemap is not in the blog_sitemap.xml. Where else could it be?
- If you have the MageWorx_XmlSitemap module, blog sitemap will be located not in blog_sitemap.xml, but pub/blog_sitemap.xml.
FAQ
Why can't Blog Sitemap XML be generated inside the general sitemap?
There are a few reasons for that:
- Magento added sitemap items extensibility only in Magento 2.3, and our Blog extension is also compatible with Magento 2.2.x that does not have these features.
- A lot of merchants use some custom Magento 2 SEO extensions that rewrite the default Magento sitemap model, and this brings conflicts between extensions.
- Different store owners reported issues like "Blog sitemap does not work properly", and the issue actually was not in the Blog extension, but in some third party SEO extension.
So we decided to move blog XML sitemap to separate files, and this works great. There are no more issues or conflicts with other modules or Magento versions. In the future, we plan to integrate a blog sitemap into the default XML file, but this can be done not faster than we stop supporting Magento 2.2.x for the blog extension.