0

Quite a broad question but I was wondering if it's possible to remove user management from WordPress and let it be handled by a remote database?

I have an existing user table with everything I need and I wish to keep all my users there. Is it possible for WordPress to somewhat ignore it's own user table and use mine instead without duplicates?

I understand that I'll probably need to keep admin roles in the user table, but when it comes to commenting or using bbPress I would like all the users to be referenced away from WordPress. I thought about maybe some sync process where the remote and the WordPress tables store the same info, but it opens some serious flood gates.

With comments at the moment I just pre-fill the comments fields with their data, which is fine but when the user changes their name/email then it's out of sync. I've just started looking at bbPress and it seems easier to make my own forum plugin rather than hacking it to work with my user table.

Thanks for the help.

1

$wpdb is a global variable for the database class. In it $wpdb->users points to the name of the users table. As long as it's the same database, you can use this to change the name of the table but it might create errors if the schema doesn't match.

Another way is to extend the wpdb class, modify it according to your needs, then replace the global $wpdb variable with an instance of your extended class.

Other way is to go through the core & hook into every user-related function in there.

I think it's best to let wordpress work on it's own

  • Thanks for the reply. Doesn't seem like the best idea to link a foreign table to WordPress then. I think I will just duplicate the user info and then run a cron job to maintain the WordPress users and keep things in tight sync. – WolfieZero Nov 1 '12 at 14:39
0

In your case, i would suggest to use WP API and create users from your second application remotely everytime any changes will occur. So you will just sync 2 user tables.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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