Hi Cédric,
Getting this kind of warnings/errors thrown in sitemap.xml is most probably because you have WP_DEBUG constant set to “true” in wp-config.php file.
I recommend hiding these messages from the front-end of your website and log them into a separate log file, you can do that by defining these constants in wp-config.php file:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
Hopefully, this shouldn’t display any of these warnings/errors in sitemap.xml file, instead they will be logged into (wp-content/debug.log) file, after doing that could you please share the full error message reported there that is related to Wordfence?
Thanks.
Hi Wfalaa,
You’re right, when turning WP_DEBUG to “false”, the error disappears.
Unfortunately, the 3 constants in wp-config.php are already set as recommended …
Thanks,
Cédric
Then I suggest getting in contact with your web host, maybe they set custom configuration regarding PHP error reporting.
Again, aside from the error being reported in sitemap.xml file or not, you can share a screenshot showing this error in the file or just share the full error message here to let us take a closer look.
Thanks.