Title: Form-handling code executing twice
Last modified: August 19, 2016

---

# Form-handling code executing twice

 *  [yoopits](https://wordpress.org/support/users/yoopits/)
 * (@yoopits)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/form-handling-code-executing-twice-1/)
 * I wrote a plugin whose form-handling code is being executed twice: once before
   the page header is output and again when the page’s main content is being produced.
   It should only execute when the main content is produced. (I suspect that my 
   theme is improperly causing it to execute when the header is being generated.)
 * Is there a theme tag to test whether code is being executed during content-generation
   time? That would give me an easy fix.

The topic ‘Form-handling code executing twice’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 0 replies
 * 1 participant
 * Last reply from: [yoopits](https://wordpress.org/support/users/yoopits/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/form-handling-code-executing-twice-1/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
