Anonymous User 9105421
(@anonymized-9105421)
I noticed same problem, looks like a small error in the code that (at least for you and me) recently started to generate the PHP warnings:
PHP Warning: Invalid argument supplied for foreach() in .../wp-content/plugins/google-sitemap-generator/sitemap-builder.php on line 476
I solved the error by editing line 476 in sitemap-builder.php from:
foreach($pages as $page) {
to:
foreach((array) $pages as $page) {
After that edit all seems OK for me. I’m using the currently latest Google XML Sitemaps Version: 4.0.8.
I haven’t had the problem but thanks for the information on how to solve it.-William
<damsko (@damsko)> Thank you for your help. Made all the changes. Error is no longer there. I will keep track on. But I think it’s fixed.
Anonymous User 9105421
(@anonymized-9105421)
Thanks guys for the heads-up that my reply was noticed.
The Google XML Sitemaps plugin works with the PHP warning but I always prefer having no warnings at all. It is now couple of days since I made the edit and after that no more “Invalid argument supplied for foreach()” warning on load of my sitemap.xml.