Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SitemapPlugin works incorrectly on large splitted sitemaps #85

Closed
Koc opened this issue Aug 11, 2017 · 8 comments
Closed

SitemapPlugin works incorrectly on large splitted sitemaps #85

Koc opened this issue Aug 11, 2017 · 8 comments

Comments

@Koc
Copy link
Contributor

Koc commented Aug 11, 2017

Hello.

There is some problem with 8b2fda4

Before this commit sitemap generates ok:

-rw-rw-r--  1 dev dev 10499185 Aug 11 15:53 sitemap-1-1.xml
-rw-rw-r--  1 dev dev  6915337 Aug 11 15:53 sitemap-1-2.xml
-rw-rw-r--  1 dev dev      347 Aug 11 15:53 sitemap.xml

after sitemap-1-1.xml missing

-rw-rw-r--  1 dev dev  6915337 Aug 11 15:53 sitemap-1-2.xml
-rw-rw-r--  1 dev dev      347 Aug 11 15:53 sitemap.xml

but sitemap.xml refers to missing sitemap-1-1.xml

@Koc Koc changed the title SitemapPlugin works incorrectly SitemapPlugin works incorrectly on large splitted sitemaps Aug 11, 2017
@Koc
Copy link
Contributor Author

Koc commented Aug 11, 2017

Even more - sitemap.xml file (sitemap index) does not contains your blog_sitemap.xml file

@magefan
Copy link
Owner

magefan commented Aug 12, 2017

Hello @Koc , it's working as expected. This changes (8b2fda4) was made to prevent conflicts with third party extensions. So we changed "class override" approach to plugin.

By using plugin we cannot add new records to sitema.xml directly, until this issue is not releases (magento/magento2#10045). Magento 2.1.8 does not include it.

So, our idea was to create separate xml for blog pages "blog_sitemap.xml". It not sould be included in sitemap.xml. Also I think that sitemap-1-1.xml missed due to less number of records, because, as I mentioned, we moved all informatoin ablout blog pages to separate xml file.

To let Search Engine robots read blog_sitemap.xml, please define it in robots.txt. Example:
Sitemap: https://domain.com/blog_sitemap.xml

@magefan magefan closed this as completed Aug 12, 2017
@Koc
Copy link
Contributor Author

Koc commented Aug 12, 2017

Can you please add note about this into extension documentation?

@mariuszjeruzal
Copy link

I think it is a bug.
In my case it also removes sitemap-1-1.xml just before blog_sitemap.xml is generated. I tested it on Magento 2.2.3.
The solution is to remove from:
Magefan\Blog\Model\Sitemap.php
Line ~24:
$this->_sitemapItems = [];

@magefan
Copy link
Owner

magefan commented Feb 15, 2019

@mariuszjeruzal , can you confirm that you use latest blog v2.8.7 ?

@mariuszjeruzal
Copy link

No it is 2.6.2. I see that in 2.8.7 there were changes to Sitemap.php - I will check it with the newest version and let you know

@magefan
Copy link
Owner

magefan commented Feb 20, 2019

@mariuszjeruzal , can you confirm that it is working for you on blog v2.8.7 ?

@mariuszjeruzal
Copy link

@magefan Magento 2.2.3 Blog 2.8.7 is working correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants