Can custom fields be used to determine specific actions upon saving a post to the database?

Which action(s) make this possible, since adding post medata seems to always occur after saving a post and thus any plugin hooking into wp_insert_post is activated before the post meta data has been added to the post.

  • @BjornW: If you can give a few more details of you use case maybe I or someone else could whip up a small example to show you how. Sep 1, 2010 at 18:02

2 Answers 2


If you are wanting to run the function after the post meta data has been added/updated, use:

add_action( 'updated_post_meta', 'my_post_meta_function' );

If there's no complicated logic involved in updating the custom fields, you could derive the new values by grabbing their (changed) values from $_POST and combining these with their existing values from the database. Base your processing upon the resulting values.

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.