WordPress.org

Forums

Add Tables to WP Database? (10 posts)

  1. redthruviolet
    Member
    Posted 6 years ago #

    Forum:

    We would like to know if it would work to add tables to the WordPress MySQL database?
    This is in the interest of keeping the number of databases we use to a minimum.

    We want to add tables that contain content for the pages, which we then read to generate the pages.

    :RedthruViolet

  2. Ze Fontainhas
    Moderator
    Posted 6 years ago #

    We want to add tables that contain content for the pages, which we then read to generate the pages.

    WordPress pages are already stored in WP's database. However there's no problem in creating other tables in the same database, as long as you can identify them later, WP's table names have a prefix, set at installation, usuallly 'wp_'.

  3. Ogre
    Member
    Posted 6 years ago #

    Adding new tables will not impact wordpress one little bit. Go for it.

  4. MoonbatWingnut
    Member
    Posted 6 years ago #

    My host - hostmysite.com gave me a hard no to that question. So you might first ask your host if it's even possible.

    Also, I got a no, you can't directly work on the WordPress database either. But they did do the maintenance that I needed.

  5. Adding new tables is fine and several plugins do just that. Twitter Tools, for one.

    @MoonbatWingnut: Just install a copy of phpMyAdmin in your own website space and you can do anything to the database you want.

  6. redthruviolet
    Member
    Posted 6 years ago #

    Otto42:

    Thank you for your post.
    Would it be a maintenance issue for upgrades?
    That is, if I upgrade WordPress, will the database be involved?

    :RedthruViolet

  7. Upgrading can modify the database, but if you're using some other table entirely, that table won't be touched by WordPress. It only looks at its own tables.

  8. mrmist
    Forum Janitor
    Posted 6 years ago #

    Yes, indeed adding tables, etc. to the WordPress database is exactly what many plugins do, and is essential to their operation. Just be sure to differentiate your tables from the core.

  9. MoonbatWingnut
    Member
    Posted 6 years ago #

    Otto42: @MoonbatWingnut: Just install a copy of phpMyAdmin in your own website space and you can do anything to the database you want.

    I set up my domain without WordPress, then added WordPress several weeks later. Then had my host point my domain to WordPress. I also have my IP address, where I have phpMyAdmin access to a different MySQL database than WordPress, but not WordPress at all. According to HostMySite, WordPress and the IP address are on two different servers.

    When you say "install in your own website space" that would have to be the WordPress server to do any good. Is that what you meant?

    I ask, because the maintenance they did reversed itself and I'd like better control.

    Thanks!

    TW

  10. mikesmobile
    Member
    Posted 6 years ago #

    I had a similar question/issue. I needed to add a table and then access the data in that table --> having it displayed on the WordPress blog.

    I found this post yesterday, http://wordpress.org/support/topic/196353, but noticed it did not have a recent response or solution. I submitted another post to the topic and low and behold, I got a response (thanks MichaelH). The plugin that MichaelH refers to looks promising. I have not installed and/or tested it yet, but I did read up a little on how to use the wpdb codex. I tested it a little and that worked.

Topic Closed

This topic has been closed to new replies.

About this Topic