WordPress action hook

update_post_meta

Fired by 13 WordPress plugins, running on 38K+ sites between them.

“This action is documented in wp-includes/meta.php”

How to use update_post_meta

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:

functions.php
add_action( 'update_post_meta', function( $meta_id, $id, $key, $replacement ) {
	// Your code runs here.
}, 10, 4 );

Argument names come from Directorist: AI-Powered Business Directory, Listings & Classified Ads's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

13 plugins that fire update_post_meta

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Directorist: AI-Powered Business Directory, Listings & Classified Ads icon Directorist: AI-Powered Business Directory, Listings & Classified Ads20,000+ installs do_action( 'update_post_meta', $meta_id, $id, $key, $replacement ) includes/cli/contact-fields.php:138
  2. 404 Solution: Redirection and Page Suggestions icon 404 Solution: Redirection and Page Suggestions10,000+ installs do_action( 'update_post_meta', $metaId, $postId, $key, $rawValue ) includes/services/WordPressPostMutationNotifications.php:54
  3. Themify Builder icon Themify Builder6,000+ installs do_action( 'update_post_meta', $meta_id, $post_id, self::META_KEY, $builder ) classes/class-builder-data-manager.php:1139
  4. SOOZ icon SOOZ2,000+ installs do_action( 'update_post_meta', $expected_meta_id, $attachment_post_id, $meta_key, $hook_value ) includes/core/attachments-media.php:2965
  5. DadsFam SEO icon DadsFam SEO20+ installs do_action( 'update_post_meta', $mid, $id, $key, $raw ) includes/class-dfseo-brain.php:6244
  6. ProRank SEO icon ProRank SEO10+ installs do_action( 'update_post_meta', $meta_id, $id, $key, $value ) includes/Core/Content/PostContentWriter.php:115
  7. Altify AI icon Altify AI10+ installs do_action( 'update_post_meta', $meta_id, $id, self::ALT_KEY, $value ) includes/class-altify-ai-review.php:82
  8. PerfLocale icon PerfLocaleFewer than 10 installs do_action( 'update_post_meta', $row['id'], $post_id, $key, $meta_value ) src/Translation/Fields/PostMetaStorage.php:95
  9. Dollar Pricing for WooCommerce icon Dollar Pricing for WooCommerceFewer than 10 installs do_action( 'update_post_meta', $meta_id, $post_id, $meta_key, $meta_value ) dolar-fiyatlandirma.php:68
  10. Sage Page Builder icon Sage Page BuilderFewer than 10 installs do_action( 'update_post_meta', $expected['meta_id'], $post_id, $layout_key, $encoded ) includes/class-layout-storage.php:216
  11. Baza Booking Calendar icon Baza Booking CalendarFewer than 10 installs do_action( 'update_post_meta', $meta_id, $post_id, $meta_key, $_meta_value ) classes/class-bbc-booking-meta.php:388
  12. JonnyAD SEO icon JonnyAD SEOFewer than 10 installs do_action( 'update_post_meta', $meta_id, $post_id, $key, $to ) includes/admin.php:1456
  13. Klusio icon KlusioFewer than 10 installs do_action( 'update_post_meta', $mid, $id, $key, $nieuw ) klusio-builder-bridge.php:345

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.