WordPress action hook

wpseo_saved_postdata

Fired by 5 WordPress plugins, running on 10M+ sites between them.

How to use wpseo_saved_postdata

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( 'wpseo_saved_postdata', function( $post_id ) {
	// Your code runs here.
}, 10, 1 );

Argument names come from RankRepair AI's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

5 plugins that fire wpseo_saved_postdata

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

  1. Yoast SEO icon Yoast SEO10+ million installs do_action( 'wpseo_saved_postdata' ) admin/metabox/class-metabox.php:559
  2. A1 Tools icon A1 Tools20+ installs do_action( 'wpseo_saved_postdata' ) includes/a1-tools-yoast.php:161
  3. Integration of Yoast wordpress SEO module with mqtranslate module icon Integration of Yoast wordpress SEO module with mqtranslate module10+ installs do_action( 'wpseo_saved_postdata' ) admin/class-metabox-wpSEOyoast-integr.php:572
  4. Agentic SEO for Visibility icon Agentic SEO for VisibilityFewer than 10 installs do_action( 'wpseo_saved_postdata' ) includes/class-visibility-seo.php:287
  5. RankRepair AI icon RankRepair AIFewer than 10 installs do_action( 'wpseo_saved_postdata', $post_id ) includes/class-rankrepair-ai-seo-adapters.php:225

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.