I know how to make custom fields for my custom post types. I also know there is the Advanced Custom Fieldsplugin.

But I need to know how I can store my custom fields in my custom post type to my custom DB tables. I've been looking for tutorials, but I only find how to create SQL tables in plugins.

How can I fetch "my data" (and save it in my own tables) and at the same time save the other data for the page the normal way?

  • When you cay "fecth my data", you refer to the data in your custom table of the data in the custom field?
    – Tomás Cot
    Commented Sep 8, 2014 at 13:53
  • I mean the data that is entered into custom fields and submitted when I click the "save new post" button. I just want to store the data in my custom fields into my custom tables.
    – Steven
    Commented Sep 8, 2014 at 14:52

2 Answers 2


Steven, I think you are looking for the save_post action, you should create the function you want to use and use the add_action function.

You can find the data from the custom fields in the $_POST array.

You don't have to worry about the "other content", at least if with that you are referring to the title, content, categories.


Here is a great post by Austin Ginder: https://anchor.host/acf-custom-fields-stored-in-custom-table/.

I've also come up with a free plugin: https://wordpress.org/plugins/acf-fields-in-custom-table/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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