What is the difference between `save_post` and `wp_insert_post` action hooks?

WordPress Expert Medium

WordPress Expert — Medium

What is the difference between `save_post` and `wp_insert_post` action hooks?

Key points

  • `save_post` triggers after saving for both inserts and updates
  • `wp_insert_post` only triggers on initial post creation
  • `wp_insert_post` provides the WP_Post object as the second parameter

Ready to go further?

Related questions