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 two wordpress websites and I want to store the data submitted by the forms in a centralized database in order to better manage the information.

Is there a way I can store form data in a different database?

share|improve this question
up vote 1 down vote accepted

You can use $wpdb to access any database you have access to (credentials for) so one site or the other could access its partner's database or both could access a third database. It shouldn't be hard but you will need to write most of the SQL to do it.

If you are in a position to refactor this, you could consider having both sites share the same database, via distinct database prefixes, and then save to custom table instead of bothering with access to multiple databases.

Your question is not really specific enough to allow for a more detailed answer.

share|improve this answer
Thank you for the help, I am just trying to figure out how I can go about solving this problem. – Tangy Jun 23 '13 at 23:24

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.