WordPress action hook · part of WordPress core

deleted_postmeta

A WordPress core action that 9 plugins also fire themselves, running on 48K+ sites between them.

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

How to use deleted_postmeta

It's an action: your callback runs at that point and receives 1 argument. Nothing needs to be returned. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_action( 'deleted_postmeta', function( $meta_ids ) {
	// Your code runs here.
}, 10, 1 );

Argument names come from UpdraftCentral Dashboard'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 →

9 plugins that fire deleted_postmeta

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

  1. Image Watermark icon Image Watermark40,000+ installs do_action( 'deleted_postmeta', $deleted ) includes/class-upload-handler.php:11575
  2. UpdraftCentral Dashboard icon UpdraftCentral Dashboard5,000+ installs do_action( 'deleted_postmeta', $meta_ids ) classes/site-meta.php:691
  3. SOOZ icon SOOZ2,000+ installs do_action( 'deleted_postmeta', $meta_ids ) includes/core/attachments-media.php:3189
  4. Hide Related Video Youtube icon Hide Related Video Youtube1,000+ installs do_action( 'deleted_postmeta', $postmeta_ids ) hide-related-video-youtube.php:25
  5. Awesome YouTube Embed icon Awesome YouTube Embed10+ installs do_action( 'deleted_postmeta', $postmetaids ) youtube-embed-for-wp.php:59
  6. ProRank SEO icon ProRank SEO10+ installs do_action( 'deleted_postmeta', $ids ) includes/Modules/Content/InternalLinking/BuilderContentSupport.php:3158
  7. PerfLocale icon PerfLocaleFewer than 10 installs do_action( 'deleted_postmeta', [ $id ] ) src/Translation/Fields/PostMetaStorage.php:195
  8. JonnyAD SEO icon JonnyAD SEOFewer than 10 installs do_action( 'deleted_postmeta', array($meta_id) ) includes/admin.php:1445
  9. Baza Booking Calendar icon Baza Booking CalendarFewer than 10 installs do_action( 'deleted_postmeta', $meta_id ) classes/class-bbc-booking-meta.php:456

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.