Support » Plugins » [Plugin: WordPress MU Domain Mapping] Domain Mapping javascript?

  • Does Domain Maping plugin insert javascript on headers?

    I have following unknown javascript added to every page of my wordpress site, but not 100% sure if this code is added from this plugin, but it looks like it’s from Domain Mapping.

    <script src='' type='text/javascript'>

    If this code is from the plugin, what does it exactly do?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Digging into the plugin code I see:

    add_action( 'wp_head', 'remote_login_js_loader' );

    No clue what it does and why its needed. Its adding 400-600ms to load time of my nicely cached websites!!

    Please help!

    I actually dove in and edited the remote_login_js_loader function in mu-plugins/domain_mapping.php
    I commented out the line that chachra pasted, around line 586.
    My wordpress network still works like a charm, only without the longer loadtimes.

    Thank You!!! For post.
    I am very lucky that I stubled on to this posting, because I was unsure what exactly to search for terms. I was searching for “wordpress domain mapping javascript error all sites” and eventually found the solution you posted.

    I did the same thing. I commented out the line of code in my domain_mapping.php file and no more JavaScript errors on all my sites.

    Thanks again!

    Mm, works for me too. But this solution doesn’t explain why the DM is doing this javascript stuff to begin with. What is it for, what does it do, and how do you control it in the prefs? There is nothing about this in the documentation.

    What gives?

    Adding remove_action( 'wp_head', 'remote_login_js_loader' );
    …to your functions.php also works.

    Still not sure how takuya tracked it to the domain-mapping plugin (or how the rest of you isolated the offending function) but I am jazzed on open source today!

    Maybe we could ask donncha or wpmuguru (the plugin authors).

    Andrea Rennick


    Customer Care at Copyblogger Media and Studiopress

    I could ask wpmuguru to take a look at this thread. he’s in the room with me.. 😉

    Ron Rennick


    MultiSite Guru

    The script is for cross domain login support.

    Ahhh. How/Does “cross domain login” actually work?
    It would be handy (but seems like a possible security risk, no?)

    Oh, I should also mention that if the script alone is supposed to enable the cross domain login to work, it doesn’t seem to.

    I am glad troycawley asked the question, because it was begging to be brought up.

    Can anyone lend information on this? I agree, it seems like a very helpful feature. I work on one system where we have over 20 sites using the WordPress 3.0 (multi domain) and it is a pain-in-the-butt to re-login every time I want to update another site.

    I will 2nd the fact that the “cross domain login” feature didn’t work for me as well. Thus, I was getting JavaScript errors on my sites resulting in me disabling it.


    Andrea Rennick


    Customer Care at Copyblogger Media and Studiopress

    If someone could point out exactly what those errors are, it would really help the devs narrow down where to look first. 😉




    Here is the JavaScript error that is being thrown on all my multi sites with the WordPress 3.0.2 setup:

    Error: syntax error
    Source File:
    Line: 1
    Source Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

    Here is the line of code that causes the error:

    <script src='' type='text/javascript'></script>

    When I comment out <strong>remove_action( 'wp_head', 'remote_login_js_loader' );</strong> from <strong>functions.php</strong> I do not get JavaScript errors anymore.

    Is there anymore information I can provide?




    A similar issue is driving my site into a perpetual redirect loop. Whenever I’m logged into another window, the published view site will continually reload without ever fully loading the page.
    When I check in Firebug, I see a javascript script reference to the root domain of my WPMU install which is a “window.location” script is the last thing in the <head>

    <script src=’’ type=’text/javascript’></script>

    loads this:

    window.location = ‘’

    Which reloads the page again…

    I have had to manually remove cookies to regain access to the published site (in the open browser – anon users can see it no problem AFAICT). I can log in to the backend, as that’s using the original domain (not the mapped domain).

    It’s very annoying and potentially damaging for client relationships.
    Has anybody a definitive answer from Donncha?
    Or should I file a bug report?
    Or is there something I’m doing wrong here??



    Troy Cawley


    Try the fix I posted above.

    But, unless is another domain within your multisite installation, I think that something else is at fault here (i.e. you’ve been hacked somehow).



    Yes, is one of mine.
    It’s not porn, BTW 😉

    I’ve now determined that the temporary fix is to delete the root WPMU site authorization cookie from the browser.

    Once that’s gone the site loads fine.
    But requires relogin of course to get back to the admin.



Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘[Plugin: WordPress MU Domain Mapping] Domain Mapping javascript?’ is closed to new replies.