Title: phreeza's Replies | WordPress.org

---

# phreeza

  [  ](https://wordpress.org/support/users/phreeza/)

 *   [Profile](https://wordpress.org/support/users/phreeza/)
 *   [Topics Started](https://wordpress.org/support/users/phreeza/topics/)
 *   [Replies Created](https://wordpress.org/support/users/phreeza/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/phreeza/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/phreeza/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/phreeza/engagements/)
 *   [Favorites](https://wordpress.org/support/users/phreeza/favorites/)

 Search replies:

## Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Add a site to WP from an external PHP script](https://wordpress.org/support/topic/add-a-site-to-wp-from-an-external-php-script/)
 *  [phreeza](https://wordpress.org/support/users/phreeza/)
 * (@phreeza)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/add-a-site-to-wp-from-an-external-php-script/#post-2235352)
 * alright so the following 2 lines added in the require block made it work for 
   me:
 *     ```
       wp_set_current_user(0,"wp_admin"); //pretend it is the network admin doing this, since regular user can't
       require_once('wp-admin/includes/admin.php'); //load the prefixes for database tables
       ```
   
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Add a site to WP from an external PHP script](https://wordpress.org/support/topic/add-a-site-to-wp-from-an-external-php-script/)
 *  [phreeza](https://wordpress.org/support/users/phreeza/)
 * (@phreeza)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/add-a-site-to-wp-from-an-external-php-script/#post-2235351)
 * Did you have any luck with this? I had the same problem and found that requiring
   wp-admin/network/admin.php does the trick. However, that requires an admin to
   be logged in, which is not really what I wanted.

Viewing 2 replies - 1 through 2 (of 2 total)