Support » Plugin: Gigaom New Relic » Yoast XML Sitemap incompatibility?

  • I just tried viewing the XML Sitemap generated by the Yoast SEO plugin, and kept getting a parse error. After examining the code, I noticed some NewRelic-related javascript in the source code. I suspect that NewRelic is being included on pages that it really shouldn’t, because of sitemap XML/XSLT parsing.

    I naively thought that deactivating the GO/NewRelic plugin would fix the problem, but I noticed the code still appearing. Then I realized that I’d have to disable the PHP extension, not your WP plugin.

    Is anyone else running into the issue of New Relic interfering with the output of the WordPress SEO Sitemap generator? Is there a fix?

Viewing 3 replies - 1 through 3 (of 3 total)
  • I can confirm this issue. There is a related discussion here:

    It sounds like the Yoast SEO plugin should make itself compatible with New Relic.

    The suggested fix is to add the following to any XML sitemaps. I’ll post here again if/when I figure out how to do so; please do the same if you beat me to it.

    if (extension_loaded('newrelic')) {

    Try this…

    Edit /plugins/wordpress-seo/inc/class-sitemaps.php

    Below 794, insert the newrelic code, so ultimately you should end up with this:

    header( 'X-Robots-Tag: noindex, follow', true );
                    header( 'Content-Type: text/xml' );
                    echo '<?xml version="1.0" encoding="' . get_bloginfo( 'charset' ) . '"?>';
    if (extension_loaded('newrelic')) {
                    if ( $this->stylesheet )
                            echo apply_filters( 'wpseo_stylesheet_url', $this->stylesheet ) . "\n";
    Josh Koenig


    Good news! This is getting fixed upstream:

    1.5 is rolling out any moment, and should resolve this problem.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Yoast XML Sitemap incompatibility?’ is closed to new replies.