WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am just creating a simple contact form, but I notice that it seems to post to an invalid page. The url in the browser is correct but the title of the page is "Page not found"

on the top of the page

$emailed = false;
if (isset($_POST['submit'])) {
    wp_mail('example@example.com', $_POST['subject'], $_POST['content']);
    $emailed = true;

below ... the HTML:

<form action="<?php the_permalink(); ?>" method="post" id="contactform">
    <div class="formelem">
        <label for="name">Name</label>
        <input type="text" name="name" class="required" />
    <div class="formelem">
        <label for="email">Email</label>
        <input type="text" name="email" class="required email" />
    <div class="formelem">
        <label for="subject">Subject</label>
        <input type="text" name="subject" class="required" />
    <div class="formelem">
        <label for="content">Content</label>
        <textarea name="content" cols="30" rows="10" class="required"></textarea>

    <input type="submit" value="Submit Message" name="submit" value="submit" />
share|improve this question
What URL is your page located? – MikeSchinkel Mar 11 '11 at 9:18
up vote 12 down vote accepted

I could be wrong, but I vaguely remember that: name, email get hijacked by WordPress to do post comments, if you renamed the form elements to be contact-name and contact-email, do you get the same issue?

share|improve this answer
Yea it's the name field, namespace it like jm_name instead :) – Backie Mar 11 '11 at 13:16

It is no only name or email problem, as Tom wrote. I had problem even with input field with name attribute same as one of my Custom Post Types. For example:

<input type="text" name="movie">

And when having registered CPT "movie" somewhere else, your form submitting will end with 404 error.

Conclusion: Don't use name, email and any registered custom post type handle as input name attribute value in your forms.

share|improve this answer
Well, I tried to answer original question with more accurate information. Ehm, probably... :-) Adding a little edit. – Marek Nov 18 '14 at 15:38
Thank you, make much more sense. – Pieter Goosen Nov 18 '14 at 15:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.