I am trying to add a form where users can submit post from front-end.

I am Following this tutorial: http:// wpshout.com/wordpress-submit-posts-from-frontend/

What I am doing is adding this code to one of my page-template. The form shows up alright but when I click on the submit button it gives me "Page not found error"

Many of the commenter saying it is not working. Can anyone point me to the right direction? Is the code incomplete?has flaws? Am I doing something wrong?


Towfiq I.

  • Can you explain your use-case? There are many options but some are not ones to suggest for all use cases. Commented Dec 27, 2010 at 14:33
  • 1
    fix your question title from Fron-End to Frontend or Front-End.
    – Philip
    Commented Dec 28, 2010 at 21:20
  • Check out this very cool and easy to follow tutorial on how to post from the front end (including photo galleries and custom fields!!). vudu.me/postreview
    – trusktr
    Commented Jun 27, 2011 at 3:29
  • You can use the code snippets from this tutorial to create a simple WP Front End Posting plugin: http://www.cozmoslabs.com/5528-wordpress-post-from-front-end/ Commented Feb 12, 2013 at 13:07

2 Answers 2

<?php $postTitle = $_POST['post_title'];
$post = $_POST['post'];
$submit = $_POST['submit'];


    global $user_ID;

    $new_post = array(
        'post_title' => $postTitle,
        'post_content' => $post,
        'post_status' => 'publish',
        'post_date' => date('Y-m-d H:i:s'),
        'post_author' => $user_ID,
        'post_type' => 'post',
        'post_category' => array(0)



<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled Document</title>

<div id="wrap">
<form action="" method="post">
<table border="1" width="200">
    <td><label for="post_title">Post Title</label></td>
    <td><input name="post_title" type="text" /></td>
    <td><label for="post">Post</label></td>
    <td><input name="post" type="text" /></td>

<input name="submit" type="submit" value="submit" />


I found this at Themeforest it's working fine,
you can do a lot of things with this, you have to add some extra code to check if a user is logged in or whatever you want to do,

In the other hand you have to search in the WordPress plugins repo to find out some great plugins,
Search for "frontend"

hope it helps

  • @Philip: I tried this but get the following error: Parse error: parse error, unexpected ';', expecting ')' in /home/www/web21/html/tornfraua/wp-admin/custom-post-new.php on line 10 Commented Feb 3, 2011 at 11:30
  • 1
    @Roflcoptr, remove the close '?>' from line 10 and it will be fine!
    – Philip
    Commented Feb 3, 2011 at 11:53
  • Is there any way to Integrate the category drop-down list?
    – Towfiq
    Commented Feb 7, 2011 at 10:42
  • @Towfiq - Yes, but i can't write at the comments the code, you have to make a new question!
    – Philip
    Commented Feb 8, 2011 at 7:32
  • @Philip can you use pastebin.com
    – Towfiq
    Commented Feb 12, 2011 at 6:47

Haha, that's my tutorial that failed badly. Sorry bout that, it was something I wrote because I never had the 404 issue everyone else had with it.

The frontend post forms I use most times open up in a modal window, for example, the post forms I made for http://wphonors.com are loaded in the thickbox popup thing, which I believe is why I never had an issue with this. I was able to do anything I wanted with my forms, ajax submit, on submit redirect to submitted posts, or just show a message and go to a random page.

My bad on failing with that tutorial, I had good intentions :)

Maybe try loading them using thickbox, it's really very simple to do. I'm still working on a follow up tutorial to redeem that failed on, but it's been hard to make it work the way most people would be likely to implement it in their sites.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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