Set primary domain anme at the registration form

Please advise how to preselect by default a specific domain name at the drop down field

  • Nastia
    • Support Rock Star

    Hello digitalventures

    Hope you’re doing well!

    As we discussed in our latest chat, this will require custom coding. I’ve flagged our second level support developers here so they can provide some feedback here.

    Please note, our developers’ response time is longer-than-normal compared to support staff response times.

    Thank you for your patience!

    Kind regards,


  • Lindeni Mahlalela
    • Recruit

    Hello digitalventures,

    I hope you are doing great today and thank you for your questions. I studied the code to see if we can do this with hooks and filters but it seems there are no usable filters on Multi Domains that can be used to achieve this.

    Fortunately, I have found the easiest way to achieve this without modifying any plugins.

    You should first create a new php file and paste the code:

    add_action('wp_footer', 'md_pre_select_script' );
    function md_pre_select_script(){
    $domain = esc_attr( $_GET['domain'] );
    <script type="text/javascript">
    jQuery(document).ready(function() {
    jQuery("#domain option[value='<?php echo $domain; ?>']").attr('selected', 'selected');
    <?php }

    Then save and upload the file to your website in the folder ‘wp-content/mu-plugins’. So you should have your new file in the folder like this:


    Or you can paste the code in your theme’s functions.php file, but remember to exclude the PHP opening tag:; ‘


    Then, assume your network is hosted on and you have the multi domains (, and then you can set your external urls to redirect to:

    Where is the primary domain of your multi site network and is the domain you want to pre select based on the redirect. When redirecting from the external domain you will have to use the url format:

    Or if you are using our Pro Sites plugin, then the registration url will be like:

    All you have to do is replace the ‘’ with the domain you want pre-selected on the registration page, and that will be it.

    I hope that helps. Please let us know f you have any further questions.

    Have a nice day.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.