Title: Run script on record save/update
Last modified: December 21, 2023

---

# Run script on record save/update

 *  [Derda](https://wordpress.org/support/users/derda/)
 * (@derda)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/run-script-on-record-save-update/)
 * Hello,
 * When I am in the WP admin area I should run a script which is executed when publishing
   a new or when updating an existing CPT record. How can I achieve this? Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/run-script-on-record-save-update/#post-17295256)
 * That’s what the hook is for:
   [https://developer.wordpress.org/reference/hooks/save_post/](https://developer.wordpress.org/reference/hooks/save_post/)
 * Examples of use can be found on the linked page.
 *  Thread Starter [Derda](https://wordpress.org/support/users/derda/)
 * (@derda)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/run-script-on-record-save-update/#post-17295378)
 * Thank you very much for the reference.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Run script on record save/update’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 2 participants
 * Last reply from: [Derda](https://wordpress.org/support/users/derda/)
 * Last activity: [2 years, 5 months ago](https://wordpress.org/support/topic/run-script-on-record-save-update/#post-17295378)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
