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 have an existing MySQL database (not Wordpress) containing user profile information. I am looking for a way to allow these users to log in to a Wordpress site and edit their profile.

It is most likely I will need to write a plugin to do this, however I'm hoping that others have had the same requirement and a solution already exists. I've looked at using BuddyPress and GravityForms as possible vehicles but they don't seem to allow connection to an existing database.

The remote database user profiles contain things like clothing sizes and profile pictures; more than the Wordpress profile. About the only thing that is not in the profiles is an email address and password.

The remote database is large and is used by other software clients, so it can not be imported or migrated into Wordpress.

share|improve this question

You can use the WPDB class to instantiate an external DB.

Looks like roughly this:

define('EXT_DB_USER', 'username');
define('EXT_DB_PASSWORD', 'password');
define('EXT_DB_NAME', 'ext_data' );
define('EXT_DB_HOST', '');


then you just call $wpdb_ext with normal WP functions just like you would #wpdb.

For log in info it's usually easiest to sync login information.

If you really want to build your own oAuth type solution take a look at KeyRing

share|improve this answer

Your Answer


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

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