Title: Inserting data in different database table
Last modified: January 12, 2022

---

# Inserting data in different database table

 *  Resolved [math1991](https://wordpress.org/support/users/math1991/)
 * (@math1991)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/inserting-custom-fields-into-different-database-table/)
 * I have a jobs management plugin that stores the jobs fields in a database table
   called wp_wpjb_job instead of in the wp_postmeta. How do I import the data from
   an xml file into this database table?
 * I have tried creating an add on plugin for this as suggested on your site but
   I’m not sure what the correct function is.
 * Thanks,
    -  This topic was modified 4 years, 4 months ago by [math1991](https://wordpress.org/support/users/math1991/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/inserting-custom-fields-into-different-database-table/#post-15246182)
 * Hi [@math1991](https://wordpress.org/support/users/math1991/),
 * > How do I import the data from an xml file into this database table? I have 
   > tried creating an add on plugin for this as suggested on your site but I’m 
   > not sure what the correct function is.
 * An add-on would work, or custom code that uses our API to do it (see pmxi_saved_post):
   [http://www.wpallimport.com/documentation/developers/action-reference/](http://www.wpallimport.com/documentation/developers/action-reference/).
 * Usually I suggest storing the fields in add-on fields, or custom fields, then
   using get_post_meta() to grab the data and the WPDB class to insert it into the
   custom table: [https://developer.wordpress.org/reference/classes/wpdb/](https://developer.wordpress.org/reference/classes/wpdb/).
   There’s an example snippet here that you can modify as needed: [https://www.wpallimport.com/documentation/developers/code-snippets/#import-data-to-custom-database-table-during-record-import](https://www.wpallimport.com/documentation/developers/code-snippets/#import-data-to-custom-database-table-during-record-import).
 *  Thread Starter [math1991](https://wordpress.org/support/users/math1991/)
 * (@math1991)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/inserting-custom-fields-into-different-database-table/#post-15246252)
 * Thats great thanks very much for your help!
 *  Thread Starter [math1991](https://wordpress.org/support/users/math1991/)
 * (@math1991)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/inserting-custom-fields-into-different-database-table/#post-15248234)
 * All working thanks
    -  This reply was modified 4 years, 4 months ago by [math1991](https://wordpress.org/support/users/math1991/).
    -  This reply was modified 4 years, 4 months ago by [math1991](https://wordpress.org/support/users/math1991/).
 *  [luxman](https://wordpress.org/support/users/luxman/)
 * (@luxman)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/inserting-custom-fields-into-different-database-table/#post-15477462)
 * Can you please explain how this one works?
 * We use the custom function to send data to a CPT? then it move everything to 
   a custom database and deletes the CPT?
 * What exactly is placed for “$value = get_post_meta($id, ‘_your_temp_field’, true);”
 * “_your_temp_field” ? just a field or entire CPT?

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Inserting data in different database table’ is closed to new replies.

 * ![](https://ps.w.org/wp-all-import/assets/icon-256x256.png?rev=2570179)
 * [WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets](https://wordpress.org/plugins/wp-all-import/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-all-import/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-all-import/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-all-import/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-all-import/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-all-import/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [luxman](https://wordpress.org/support/users/luxman/)
 * Last activity: [4 years, 2 months ago](https://wordpress.org/support/topic/inserting-custom-fields-into-different-database-table/#post-15477462)
 * Status: resolved