WordPress.org

Ready to get started?Download WordPress

Forums

Google XML Sitemaps
(Mild) Incompatibility with domain mapping plugin (1 post)

  1. Matthew Boynes
    Member
    Posted 2 years ago #

    This plugin gives itself high priority in the template_redirect chain, and supersedes the domain mapping redirect. One can fix this by deregistering the hook and reregistering it with a lower priority in one's code (either a theme or in a proprietary network-activated plugin).

    add_action('init', 'alter_sitemap_chain', 1001);
    
    function alter_sitemap_chain() {
    	remove_action( 'template_redirect', array('GoogleSitemapGeneratorLoader', 'DoTemplateRedirect'), 1, 0 );
    	add_action('template_redirect', array('GoogleSitemapGeneratorLoader', 'DoTemplateRedirect'), 11, 0 );
    }

    Note that if you have another plugin or theme which uses template_redirect that wouldn't otherwise be run as a result of this plugin running early in the chain and exiting, it's possible that this could then cause undesirable behavior for you. Naturally, this should be tested thoroughly on any system on which it is deployed.

    I'm sure there are other issues with the domain mapping plugin and this one (i.e. if using the "Redirect admin requests" option in DM plugin, Google et al are probably notified of the subdomain URL and not the domain-mapped URL). As I discover and fix them, I'll post my solutions in this thread.

    http://wordpress.org/extend/plugins/google-sitemap-generator/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

  • RSS feed for this topic
  • Started 2 years ago by Matthew Boynes
  • This topic is not a support question
  • WordPress version: 3.3.1