Currently using the WP-mu-domain-mapping plugin on a multi-network installation. The domain mapping works fine with the provided sunrise.php file, however it breaks (sites no longer map correctly) when I move the plugin to our mu-plugins directory. I've tried the following, but it doesn't work.

$sunrises = array(
"dm_sunrise" =>  dirname( __FILE__ ) .  "/mu-plugins/domain-mapping/inc/sunrise.php"

foreach( $sunrises as $sunrise ){
    if( is_readable( $sunrise ) ){
        include $sunrise;

1 Answer 1


As per the instructions for setting up WordPress MU Domain Mapping, sunrise.php needs to be placed directly in your /wp-content directory. It's not a plugin in the traditional sense, so can't be placed in mu-plugins (or even plugins for that matter).

Setting up this plugin can take a bit of manual work so take care to follow the instructions carefully, including the modifications you need to make to wp-config.php.

By the way, the current status of this plugin is somewhat unclear as - for new sites - it appears its functionality is now baked in to Wordpress core. It is (apparently) only now required for pre-existing Multisites which were converted some time ago. You can see various posts from the maintainer of the plugin in this support forum which confirm this.

  • Thanks for pointing this out @tim-malone. After some digging it turns out that siteurl maps the domain. Native permissions are restricted to network admins so we've tweaked it so that site owners (regular admins) can update this setting. Essentially now replacing domain mapping on our multi-network install. Thanks! Jun 3, 2016 at 17:18
  • Glad you solved it @gabethegrape! If you'd like, to help future visitors, you can post an additional answer with your solution, or accept this answer by clicking the check mark to the left of it.
    – Tim Malone
    Jun 4, 2016 at 20:56
  • sunrise.php is required if you want to use Wordpress MU Domain Mapping plugin. That plugin throws an error in the settings page if sunrise is not present and enabled in wp-config.php. Jan 19, 2019 at 9:58
  • 1
    I can confirm that sunrise.php is no longer required for domain mapping when installing brand new Multisite networks these days. Aug 1, 2022 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.