WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am creating a WordPress Network multisite blog in a university environment. It's set up in subdirectory mode, so that each new blog appears as a subdirectory off a common domain name.

The Network authenticates against our corporate Active Directory using LDAP. Only Active Directory users may sign in.

The first time a user signs in, our Active Directory plugin creates a WordPress account that corresponds to that user's Active Directory account. Each subsequent sign in, that account's properties are updated with the Active Directory account information.

We expect to have hundreds, possibly thousands of blogs in the system. In the interest of reducing administrator time, I want this to be automated, either:

  1. From time to time, we run a script that checks the WordPress network against our Active Directory and automatically creates or deletes blogs depending on whether the blog's name corresponds to an account in the Active Directory.
  2. Users may self-register for their own blog, and the blog's URL is based off an attribute of their account that will be imported from the Active Directory.

So far, my searches are not revealing canned ways of doing this.

Are there existing modules that can help? Or am I looking at something custom?

share|improve this question
This sounds very custom - have you looked at the tools in wp-cli to automate the wordpress side of this? – benz001 Jun 10 '14 at 23:38
We're mostly a .NET shop, so we're going to make a separate .NET-based app that does all of this and talks directly to the WordPress database. – Aren Cambre Jun 14 '14 at 3:25
Whilst unfamiliar with LDAP and Active Directory if it's simply a case of updating user information each time you log in - use update_user_meta( $user_id, $meta_key, $meta_value); in the login loop, assuming you can pass data through the variables? – Bysander Jul 14 '14 at 12:34
I'd definitely explore the use of wp-cli especially for creation/deleting sites. My advice would also be not to directly change the database unless the changes you make are to entries outside of the WordPress core (i.e. plugin specific). Failing that you can set up a cron job Your final option (apologies if this is against the rules) would be to look at some premium plugins like the ones here: premium.wpmudev.org/projects/tag/wordpress-multisite/… – Craig Pearson Nov 26 '15 at 11:50
Is this still an open question, or did you find/develop a solution you can share? – toscho Dec 25 '15 at 1:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.