Title: Fire plugin function only when post/page is *first* published?
Last modified: August 19, 2016

---

# Fire plugin function only when post/page is *first* published?

 *  [harknell](https://wordpress.org/support/users/harknell/)
 * (@harknell)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/fire-plugin-function-only-when-postpage-is-first-published/)
 * Hi, from what I can see the hook publish_page is fired whenever a page is published,
   or also if a page is updated. I don’t suppose there’s a hook that *only* occurs
   when a page is initially created? I believe there’s a hook to fire when a page
   is edited, so I’m wondering why publish_page actually also fires when a page 
   is edited later….seems sort of wrong. I only want a function in a plugin I’m 
   writing to happen upon initial creation of a page, not when it’s later edited.
 * Of course I could write up a query to see if it’s in the database and blah, blah….
   But It seems to me a hook that occurs only at initial publish of a page would
   be a nice addition to things (unless I’m missing it, please let me know)

The topic ‘Fire plugin function only when post/page is *first* published?’ is closed
to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [harknell](https://wordpress.org/support/users/harknell/)
 * Last activity: [16 years, 9 months ago](https://wordpress.org/support/topic/fire-plugin-function-only-when-postpage-is-first-published/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
