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

---

# Form-handling code executing twice

 *  Resolved [yoopits](https://wordpress.org/support/users/yoopits/)
 * (@yoopits)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/form-handling-code-executing-twice/)
 * 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.

Viewing 1 replies (of 1 total)

 *  Thread Starter [yoopits](https://wordpress.org/support/users/yoopits/)
 * (@yoopits)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/form-handling-code-executing-twice/#post-1877921)
 * I just noticed I’m in the wrong forum. Please ignore this. I will repost this
   in the Hacks forum. Sorry.

Viewing 1 replies (of 1 total)

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

 * 1 reply
 * 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/#post-1877921)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
