WordPress action hook · part of WordPress core
update_postmeta
A WordPress core action that 15 plugins also fire themselves, running on 203K+ sites between them.
“Fires immediately before updating a post's metadata.”
How to use update_postmeta
It's an action: your callback runs at that point and receives 4 arguments. Nothing needs to be returned.
Add this to your theme's functions.php or a small custom plugin:
add_action( 'update_postmeta', function( $meta_id, $object_id, $meta_key, $meta_value ) {
// Your code runs here.
}, 10, 4 );Argument names come from WP Hide & Security Enhancer's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
This hook is fired by WordPress core too. Official reference on developer.wordpress.org →
15 plugins that fire update_postmeta
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
bbPress100,000+ installs
do_action( 'update_postmeta', $meta_id, $object_id, $meta_key, $new_count )includes/core/abstraction.php:355 -
WP Hide & Security Enhancer50,000+ installs
do_action( 'update_postmeta', $meta_id, $object_id, $meta_key, $meta_value )include/wph.class.php:1730 -
Directorist: AI-Powered Business Directory, Listings & Classified Ads20,000+ installs
do_action( 'update_postmeta', $meta_id, $id, $key, maybe_serialize( $replacement ) )includes/cli/contact-fields.php:139 -
WP Multilang10,000+ installs
do_action( 'update_postmeta', $meta_id, $object_id, $meta_key, $meta_value )includes/abstracts/abstract-wpm-object.php:328 -
404 Solution: Redirection and Page Suggestions10,000+ installs
do_action( 'update_postmeta', $metaId, $postId, $key, $serializedValue )includes/services/WordPressPostMutationNotifications.php:55 -
Themify Builder6,000+ installs
do_action( 'update_postmeta', $meta_id, $post_id, self::META_KEY, $builder )classes/class-builder-data-manager.php:1140 -
UpdraftCentral Dashboard5,000+ installs
do_action( 'update_postmeta', $meta_id, $object_id, $meta_key, $meta_value )classes/site-meta.php:491 -
SOOZ2,000+ installs
do_action( 'update_postmeta', $expected_meta_id, $attachment_post_id, $meta_key, $serialized_value )includes/core/attachments-media.php:2966 -
ProRank SEO10+ installs
do_action( 'update_postmeta', $meta_id, $post_id, $key, $stored_value )includes/Modules/Content/InternalLinking/BuilderContentSupport.php:3142 -
PerfLocaleFewer than 10 installs
do_action( 'update_postmeta', $row['id'], $post_id, $key, $stored )src/Translation/Fields/PostMetaStorage.php:97 -
JonnyAD SEOFewer than 10 installs
do_action( 'update_postmeta', $meta_id, $post_id, $key, $to )includes/admin.php:1457 -
Dollar Pricing for WooCommerceFewer than 10 installs
do_action( 'update_postmeta', $meta_id, $post_id, $meta_key, $meta_value )dolar-fiyatlandirma.php:69 -
Sage Page BuilderFewer than 10 installs
do_action( 'update_postmeta', $expected['meta_id'], $post_id, $layout_key, $encoded )includes/class-layout-storage.php:218 -
Baza Booking CalendarFewer than 10 installs
do_action( 'update_postmeta', $meta_id, $post_id, $meta_key, $meta_value )classes/class-bbc-booking-meta.php:389 -
KlusioFewer than 10 installs
do_action( 'update_postmeta', $mid, $id, $key, $nieuwDb )klusio-builder-bridge.php:347
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.