XML Sitemaps

Error with XML Sitemap Generator for Google

You may have this kind of error with XML Sitemap Generator for Google :

PHP Fatal error: Uncaught TypeError: Unsupported operand types: int * string in /wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorstandardbuilder.php:507
Stack trace:
#0 /wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorstandardbuilder.php(44): GoogleSitemapGeneratorStandardBuilder->build_taxonomies()
#1 /wp-includes/class-wp-hook.php(307): GoogleSitemapGeneratorStandardBuilder->content()
#2 /wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
#3 /wp-includes/plugin.php(476): WP_Hook->do_action()
#4 /wp-content/plugins/google-sitemap-generator/sitemap-core.php(1961): do_action()
#5 /wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorloader.php(387): GoogleSitemapGenerator->show_sitemap()
#6 /wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorloader.php(250): GoogleSitemapGeneratorLoader::call_show_sitemap()
#7 /wp-includes/class-wp-hook.php(305): GoogleSitemapGeneratorLoader::do_template_redirect()
#8 /wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
#9 /wp-includes/plugin.php(476): WP_Hook->do_action()
#10 /wp-includes/template-loader.php(13): do_action()
#11 /wp-blog-header.php(19): require_once(‘/home/*****/…’)
#12 /index.php(17): require(‘/home/*****/…’)
#13 {main}
thrown in /wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorstandardbuilder.php on line 507

Or :

PHP Fatal error:  Uncaught Error: Call to undefined method GoogleSitemapGenerator::AddElement() in /wp-content/themes/mytheme/functions.php:84
Stack trace:
#0 /wp-includes/class-wp-hook.php(307): addCustomSitemap(Object(GoogleSitemapGenerator))
#1 /wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
#2 /wp-includes/plugin.php(474): WP_Hook->do_action(Array)
#3 /wp-content/plugins/google-sitemap-generator/sitemap-core.php(1945): do_action('sm_build_index', Object(GoogleSitemapGenerator))
#4 /wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorloader.php(387): GoogleSitemapGenerator->show_sitemap(Array)
#5 /wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorloader.php(250): GoogleSitemapGeneratorLoader::call_show_sitemap('params=;html=tr...')
#6 /wp-includes/class-wp-hook.php( in /wp-content/themes/mytheme/functions.php on line 84

Or :

PHP Warning:  DOMDocument::loadXML(): Input is not proper UTF-8, indicate encoding !
Bytes: 0xFF 0xFF 0x72 0x77 in Entity, line: 1012 in /wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1653
PHP Warning:  DOMDocument::loadXML(): xmlParseComment: invalid xmlChar value 28 in Entity, line: 9468 in /wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1653
PHP Warning:  DOMDocument::loadXML(): Extra content at the end of the document in Entity, line: 9468 in /wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1653
PHP Warning:  DOMDocument::loadXML(): Input is not proper UTF-8, indicate encoding !
Bytes: 0xFF 0xFF 0x28 0x4D in Entity, line: 1054 in /wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1653
PHP Warning:  DOMDocument::loadXML(): xmlParseComment: invalid xmlChar value 22 in Entity, line: 9510 in /wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1653
PHP Warning:  DOMDocument::loadXML(): Extra content at the end of the document in Entity, line: 9510 in /wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1653
PHP Warning:  DOMDocument::loadXML(): Input is not proper UTF-8, indicate encoding !
Bytes: 0xFF 0xFF 0x72 0x77 in Entity, line: 982 in /wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1653
PHP Warning:  DOMDocument::loadXML(): xmlParseComment: invalid xmlChar value 28 in Entity, line: 9438 in /wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1653
PHP Warning:  DOMDocument::loadXML(): Extra content at the end of the document in Entity, line: 9438 in /wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1653
PHP Warning:  DOMDocument::loadXML(): Input is not proper UTF-8, indicate encoding !
Bytes: 0xFF 0xFF 0x72 0x77 in Entity, line: 1024 in /wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1653
PHP Warning:  DOMDocument::loadXML(): xmlParseComment: invalid xmlChar value 28 in Entity, line: 9480 in /wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1653
PHP Warning:  DOMDocument::loadXML(): Extra content at the end of the document in Entity, line: 9480 in /wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1653
PHP Warning:  DOMDocument::loadXML(): Input is not proper UTF-8, indicate encoding !
Bytes: 0xFF 0xFF 0x72 0x77 in Entity, line: 1006 in /wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1653
PHP Warning:  DOMDocument::loadXML(): xmlParseComment: invalid xmlChar value 28 in Entity, line: 9462 in /wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1653
PHP Warning:  DOMDocument::loadXML(): Extra content at the end of the document in Entity, line: 9462 in /wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1653
PHP Warning:  DOMDocument::loadXML(): Input is not proper UTF-8, indicate encoding !
Bytes: 0xFF 0xFF 0x72 0x77 in Entity, line: 1090 in /wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1653
PHP Warning:  DOMDocument::loadXML(): xmlParseComment: invalid xmlChar value 28 in Entity, line: 9546 in /wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1653
PHP Warning:  DOMDocument::loadXML(): Extra content at the end of the document in Entity, line: 9546 in /wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1653
PHP Warning:  DOMDocument::loadXML(): Input is not proper UTF-8, indicate encoding !
Bytes: 0xFF 0xFF 0x28 0x4D in Entity, line: 1012 in /wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1653
PHP Warning:  DOMDocument::loadXML(): xmlParseComment: invalid xmlChar value 22 in Entity, line: 9468 in /wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1653
PHP Warning:  DOMDocument::loadXML(): Extra content at the end of the document in Entity, line: 9468 in /wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1653
PHP Warning:  DOMDocument::loadXML(): Input is not proper UTF-8, indicate encoding !
Bytes: 0xFF 0xFF 0x72 0x77 in Entity, line: 1024 in /wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1653
PHP Warning:  DOMDocument::loadXML(): xmlParseComment: invalid xmlChar value 28 in Entity, line: 9480 in /wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1653
PHP Warning:  DOMDocument::loadXML(): Extra content at the end of the document in Entity, line: 9480 in /wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1653

Or :

PHP Warning: A non-numeric value encountered in /wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorstandardbuilder.php on line 493

Or :

PHP Warning: Undefined array key 0 in /wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorstandardbuilder.php on line 696
PHP Warning: Attempt to read property “taxonomy” on null in /wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorstandardbuilder.php on line 696
PHP Warning: Undefined array key 0 in /wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorstandardbuilder.php on line 697
PHP Warning: Attempt to read property “taxonomy” on null in /wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorstandardbuilder.php on line 697

There are multiple solutions to try to make it work.

Updates

The first thing to do if you are stuck with XML Sitemap Generator for Google is to ensure that all your WordPress is up to date. You should check your :

  • WordPress
  • Plugins
  • Theme

Once all these updates are done, check back if these errors appear.

Check XML Sitemap Generator for Google

Sometimes, you just need to disable the plugin, and enable it just after to make it work again.

If it doesn’t work, your XML Sitemap Generator for Google plugin may be corrupted. To ensure that it’s not your case, you have to re-download the plugin (or the theme delivered with the plugin) and try to install it again.

Check others plugins

Are you sure that the error is related to XML Sitemap Generator for Google? Maybe not.

It could be related to another plugin that is not compatible. It could happen when you use a cache plugin, a security plugin, or simply a poorly developed plugin.

Disable all plugins. Then, check for your error, if the error is still there, the problem is not related to plugins compatibility. If there are no more errors, then enable every plugin one by one and check for the error. The goal is to target the plugin involved.

Try another theme

The error can be a problem with your theme.

If it’s not already done, then you should install & activate the default WordPress theme like Twenty Twenty-Two. Check for the error, and see what is happening to be sure that your WordPress theme is not the cause.

Permalinks & htaccess

If it doesn’t work, you may have a problem with your WordPress permalinks and/or your htaccess file. You should go on your WordPress dashboard, and re-saving permalinks from the permalinks page.

Contact the developer

If all these solutions don’t work, we advise you to contact the plugin developer.

You may have found a new bug, or a specific issue. You should get in touch with the developer either on the WordPress plugin forum, either by mail, either on their specific website with their own support.

Alternative solutions

If the developer doesn’t reply, or your problem is very urgent, then you should try an alternative to the plugin.

There are thousands of plugins on the official directory, and many others outside. You should try to find and test them!

If the issue is very specific, and the plugin could not be replaced, we advise you to contact an expert.
This is the best way to ensure you're not going to break your site anymore.