Title: [Plugin: Polylang] xml sitemap problem
Last modified: August 20, 2016

---

# [Plugin: Polylang] xml sitemap problem

 *  [Baz11](https://wordpress.org/support/users/baz11/)
 * (@baz11)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-polylang-xml-sitemap-problem/)
 * Your plugin is great, but problem with xml-sitemap is great too. XML & Google
   News Sitemap Feeds is only one alternative, but it has its own questions. Plaese
   make Your plugin compatible with Google XML Sitemaps and it will be the best.
 * [http://wordpress.org/extend/plugins/polylang/](http://wordpress.org/extend/plugins/polylang/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-polylang-xml-sitemap-problem/#post-3097120)
 * What’s wrong with Google XML Sitemaps?
 *  Thread Starter [Baz11](https://wordpress.org/support/users/baz11/)
 * (@baz11)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-polylang-xml-sitemap-problem/#post-3097190)
 * I use Google XML Sitemaps v3.2.8. When I adding new posts in other languages ​​(
   non-default) they are not added to the XML sitemap. Format of permalinks – [http://site.com/post.html](http://site.com/post.html).
   When I use format of permalinks – [http://site.com/en/post.html](http://site.com/en/post.html)
   post are added to XML sitemap without “en/”.
 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-polylang-xml-sitemap-problem/#post-3097232)
 * I made tests and observed this:
 * 1. When the language is set form the content -> no problem
    2. When the language
   code is added to all urls: * if the sitemap is generated manually -> no problem*
   if the sitemap is generated after creating a new post -> all urls are wrong.
 * I don’t know why Google XML Sitemaps does call permalinks filters in one case,
   and not in the other…
 * From my experience, even if there are still some things which not work correctly
   with WordPress SEO, the sitemaps generated by WordPress SEO are correct.
 *  [Nerdvous](https://wordpress.org/support/users/nerdvous/)
 * (@nerdvous)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-polylang-xml-sitemap-problem/#post-3097309)
 * I recently ran into this problem and also poked around a little and had the same
   observations. So i dug around Google XML Sitemaps’ code and found out some interesting
   things.
 * _Note: Please double check the following things since I’m a Jr php developer 
   and might be wrong in some way._
 * First of all. The generation breaks only when the sitemap is generated in a background
   process (the checkbox in the plugin settings is selected).
 * So I poked around a little more and found out that the Sitemaps plugin uses the
   WP-Cron to schedule the XML build 15 seconds after a post has been saved. What
   I believe to be the cause of the problem is that by the time the scheduler calls
   the script, the execution of the current one is finished and Polylang’s hooks
   do not fire.
 * Again: I could be off here, but in case I’m not … I hope this has been a helpful
   hint as to what the underlying problem is. I’m not sure if there’s a way to fix
   it in some future release, but if there is I’d really appreciate it since it 
   would save me a lot of headaches. 🙂
 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-polylang-xml-sitemap-problem/#post-3097313)
 * Thank you for pointing me to the right direction. The cron process stops before
   Polylang adds its filters. This specific issue will be solved in v1.0.
 * However, the compatibility between both plugins won’t be perfect and I fear I
   can’t do nothing to solve this. There will still be issues with homepage, archives
   and author pages.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘[Plugin: Polylang] xml sitemap problem’ is closed to new replies.

 * ![](https://ps.w.org/polylang/assets/icon-256x256.png?rev=3433336)
 * [Polylang](https://wordpress.org/plugins/polylang/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/polylang/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/polylang/)
 * [Active Topics](https://wordpress.org/support/plugin/polylang/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/polylang/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/polylang/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [Chouby](https://wordpress.org/support/users/chouby/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-polylang-xml-sitemap-problem/#post-3097313)
 * Status: not resolved