How to let registered users have access to all sites in MU? (6 posts)

  1. lilblogger
    Posted 4 years ago #

    I have a classifieds WordPress website that has city specific sites (e.g. domain.com/seattle, domain.com/newyork).

    Once someone registers at domain.com/seattle, I want them to be able to also post on domain.com/newyork without having to re-register for domain.com/newyork.

    How do I do this?

  2. They don't have to re-register to post comments on all sub sites. Do you want tthem to be able to post comments, or actual blog posts?

  3. lilblogger
    Posted 4 years ago #

    Blog posts

  4. Then you'll have to register them as author on every site when they sign up.

    I know dsader left a script in here somewhere.... :D

  5. David Sader
    Posted 4 years ago #

    In here or the wpmu forums from a while ago:




    Anyway, something like this works on my test server with only a handful of blogs:

    function ds_add_new_user_to_all_blogs($user_id) {
      global $wpdb;
      $blog_list = $wpdb->get_results("SELECT blog_id FROM " . $wpdb->blogs);
      foreach ($blog_list as $blog) {
        add_user_to_blog($blog->blog_id, $user_id, 'author');
    add_action( 'wpmu_new_user', 'ds_add_new_user_to_all_blogs' );

    This adds user as author to all other blogs, while user gets admin role on his "gimme site" from signup.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.