WordPress action hook

wpseo_save_indexable

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

“Action: 'wpseo_save_indexable' - Allow developers to perform an action when the indexable is updated.”

How to use wpseo_save_indexable

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

functions.php
add_action( 'wpseo_save_indexable', function( $post_id, $post ) {
	// Your code runs here.
}, 10, 2 );

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

8 plugins that fire wpseo_save_indexable

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_save_indexable', $indexable, $indexable_before ) src/helpers/indexable-helper.php:314
  2. Soro icon Soro10,000+ installs do_action( 'wpseo_save_indexable', $post_id, get_post($post_id) ) soro-seo.php:1002
  3. iGen SEO icon iGen SEO900+ installs do_action( 'wpseo_save_indexable', $post_id, get_post( $post_id ) ) includes/class-igen-seo-connector.php:3449
  4. Edward icon Edward200+ installs do_action( 'wpseo_save_indexable', $post_id, get_post($post_id) ) includes/YoastIndexable.php:49
  5. Refine Rank AI icon Refine Rank AIFewer than 10 installs do_action( 'wpseo_save_indexable', $post_id, $object_type ) refine-rank-ai.php:6048
  6. SEOvault AI Connector icon SEOvault AI ConnectorFewer than 10 installs do_action( 'wpseo_save_indexable', $post_id, get_post( $post_id ) ) includes/rest-api.php:507
  7. RankRepair AI icon RankRepair AIFewer than 10 installs do_action( 'wpseo_save_indexable', $post_id ) includes/class-rankrepair-ai-seo-adapters.php:223
  8. SEOvault AI icon SEOvault AIFewer than 10 installs do_action( 'wpseo_save_indexable', $post_id, get_post( $post_id ) ) includes/Api/Router.php:1369

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.