Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


WordPress - Add database tables

Posted on 2015-02-08
Medium Priority
Last Modified: 2015-02-09
I've sort of gotten the impression that I can add custom tables to the WordPress database that I could use for my own purposes.

Is that true?

If so, how do I do that?

And, how do I get access to the database connection info so I can do custom php to manipulate that data.
Question by:Richard Korts
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 400 total points
ID: 40597484
WordPress just uses a MySQL database.  You can add whatever you want.  Since Wordpress accesses the database for every page, the connection will probably be open already.  Just look thru the Wordpress code to see how they are doing it and then copy it for your own use.
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40597563
This really sounds like it could be going in one of two directions.  Are you talking about adding tables and CRUD by creating custom WordPress code via their functions or as a plugin or simply adding more tables in the same mysql database housing WordPress and querying them in?  Both are possible, but the answer changes a bit depending on what you want to do.

In both cases, you will be leaning on the wpdb class as a shortcut, though:


Author Comment

by:Richard Korts
ID: 40599057
To All,

I'm gathering that I can open the wp database using phpMyadmin on the server, then add tables, etc.

Is that correct?

Can I use a DIFFERENT database that contains my own data ONLY?
LVL 70

Accepted Solution

Jason C. Levine earned 1600 total points
ID: 40599070
I'm gathering that I can open the wp database using phpMyadmin on the server, then add tables, etc.

Is that correct?


Can I use a DIFFERENT database that contains my own data ONLY?

Also yes, you would just need to use a different set of connection functions to connect to both it and the WordPress instance at the same time.  I tend to think that's overthinking the problem...you're already connected to the WordPress database by default, just stick the new tables in there and call it a day.

Featured Post

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to install BuddyPress on your self-hosted WordPress site It’s been called everything from “social networking in a box” to “Facebook without the terms of service,” but until Feb. 16, BuddyPress was a relatively unknown outside the WordPress MU…
Transferring a wordpress site from a host or local dev server to another host can be a pain. So I've included my steps on how I have accomplished this task. Steps include an assumption that you have Cpanel access or Ftp access.. If you do not hav…
This video teaches users how to migrate an existing Wordpress website to a new domain.
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question