Spring Sale! Save 30% on all books w/ code: PLANET24
Web Dev + WordPress + Security

WordPress Plugin: User Submitted Posts

[ User Submitted Posts ]

User Submitted Posts enables your visitors to submit posts and images from anywhere on your site via template tag or shortcode. User-submitted posts optionally include tags, categories, post titles, and more. You can set submitted posts as draft, publish immediately, or after some number of approved posts. Also enables users to upload multiple images when submitting a post. Everything super-easy to customize via Admin Settings page.

Update! Pro version of User Submitted Posts now available — check it out »

Let your visitors submit content

User Submitted Posts makes it easy to display a public post-submission form virtually anywhere on your site. Use the USP shortcode to display the submission form in any post or page, or use the USP template tag to include the form anywhere in your theme design. Visitors may then use the form to submit posts to your site. Depending on your preferences, user-submitted posts may include the following input fields:

  • Name
  • Email
  • URL
  • Post Title
  • Post Tags
  • Post Category
  • Post Content
  • Custom Field
  • Challenge Question
  • Google reCAPTCHA
  • Post Images

Using the Settings Page, you choose which fields to display, min/max number of images, min/max image size, redirect location, error messages and more. User Submitted Posts makes it easy to setup just about any type of user-submitted functionality for your WordPress-powered site. Here are some examples of how the USP plugin could be used:

  • Public Submit a Link form with tags
  • Simple Submit News form with post, title & author
  • Use as Contact Form that allows image attachments
  • Use as an Image Uploader, maybe with tags, title or whatever

Once a user has submitted a post, it’s saved as a “Draft” by default, but may optionally be set to “Publish Immediately” or even to publish if the author has “x” number of approved submissions. The plugin also displays a User Submitted Posts button at the top of the Posts Page that lets you filter all user-submitted posts/drafts with the click of a button.

Features

  • Let visitors submit posts from anywhere on your site
  • Use template tag or shortcode to display the form anywhere
  • Includes customizable captcha and hidden field to stop spam
  • Submitted posts may include any/all of the available fields
  • Redirect user anywhere after successful post submission
  • Includes template tags for displaying submitted content
  • New HTML5 submission form with streamlined CSS styles

Image Uploads

  • Optionally allow/require visitors to upload any number of images
  • Specify minimum and maximum width and height for uploaded images
  • Specicy min/max number of allowed image uploads for each post
  • Includes jQuery snippet for easy choosing of multiple images

Customization

  • Control which fields are displayed in the submission form
  • Choose which categories users are allowed to select
  • Assign submitted posts to any registered user
  • Customizable success, error, and upload messages
  • Plus options for the captcha, auto-publish, and redirect-URL
  • Choose form style: Classic, HTML5, or plain (disable styles)

Post Management

  • Custom Fields saved w/ each post: name, IP, URL, images, et al
  • Set submitted posts to any status: Draft, Publish, or Moderate
  • One-click post-filtering of submitted posts in the Admin Area
  • Includes template tags for easy display of submitted images

Installation & Usage

Overview

  1. Install USP just like any other WordPress plugin
  2. Go to the “User Submitted Posts” settings and customize your options
  3. Display the submission form on your page(s) using template tag or shortcode

Displaying the submission form

To display the form on a post or page, use the shortcode:

[user-submitted-posts]

To display the form anywhere in your theme, use the template tag:

<?php if (function_exists('user_submitted_posts')) user_submitted_posts(); ?>

Customizing the submission form

  • To style the submission form, use the included CSS file located at: /resources/usp.css
  • To add custom JavaScript, use the included JS file located at: /resources/usp.js

Customizing user-submitted posts

User-submitted posts are just like any other post, with the exception that they each contain a set of custom fields. The custom fields include extra information about the post:

  • is_submission – indicates that the post is in fact user-submitted
  • user_submit_image – URLs of any submitted images (one field per image)
  • user_submit_ip – the IP address of the submitted-post author
  • user_submit_name – the name of the submitted-post author
  • user_submit_url – the submitted URL

So when user-submitted posts are displayed on your website, say on the home page or single-view, these custom fields are available to you in your theme files. This enables you to customize the user-submitted posts by displaying the submitted name, URL, images, and so forth. Here are two articles for those new to using WordPress custom-fields:

Template Tags

Additionally, the USP plugin also includes a set of template tags for customizing your user-submitted posts:

usp_is_public_submission()
Returns a boolean value indicating whether the specified post is a public submission
Usage: <?php if (function_exists('usp_is_public_submission')) usp_is_public_submission(); ?>

usp_get_post_images()
Returns an array of URLs for the specified post image
Usage: <?php $images = usp_get_post_images(); foreach ($images as $image) { echo $image; } ?>

usp_post_attachments()
Prints the URLs for all post attachments.
Usage:  <?php if (function_exists('usp_post_attachments')) usp_post_attachments(); ?>
Syntax: <?php if (function_exists('usp_post_attachments')) usp_post_attachments($size, $beforeUrl, $afterUrl, $numberImages, $postId); ?>
Paramters:
    $size         = image size as thumbnail, medium, large or full -> default = full
    $beforeUrl    = text/markup displayed before the image URL     -> default = <img src="
    $afterUrl     = text/markup displayed after the image URL      -> default = " />
    $numberImages = the number of images to display for each post  -> default = false (display all)
    $postId       = an optional post ID to use                     -> default = uses global post

usp_author_link()
For public-submitted posts, this tag displays the author's name as a link (if URL provided) or plain text (if URL not provided)
For normal posts, this tag displays the author's name as a link to their author's post page
Usage: <?php if (function_exists('usp_author_link')) usp_author_link(); ?>

For more tags, check out USP at WordPress.org, and/or the source code of the plugin file located at: /library/template-tags.php

Screenshots

Here are some screenshots of the USP plugin:

Note: these screenshots were taken awhile ago. For fresh screenshots from more recent versions of the plugin, check out USP at WordPress.org.

Download & Demo

To download the free version of User Submitted Posts, visit the plugin homepage at the WordPress.org Plugin Directory.

About the Author
Jeff Starr = Fullstack Developer. Book Author. Teacher. Human Being.
USP Pro: Unlimited front-end forms for user-submitted posts and more.

120 responses to “WordPress Plugin: User Submitted Posts”

  1. Albert A Corbett 2011/02/22 3:25 pm

    I’M SORRY, MY ENGLISH NOT GOOD!! “/

    I would like to clarify some doubts … that in my first wordpress (perhaps by thema) does not hold the “custom fields” and believe that for this to occur the problem itself … even the person filling out the name and URL, in the view of the post ae displays the name of the person, but the link is directed to my administrator profile, why?

    Another doubt is that in my wordpress not insert images on my server, I wonder if there is the possibility of inserting an extra field for “url of image” for external images, it is possible?

  2. is it possible to restrict a user from posting in a particular cat… eg this is what i would like to do have 3 categories…..
    Admin
    User
    Anonymous…

    they will all be able to reach each post, but i want people to have to register to post as a user, do you understand?

  3. Also can i have users submit to pages also? like i want all submissions to goto the Browse page

  4. Hi, how can i show the url of the post? There’s a field of URL but how to show it in the post?

    And, how to change the post to be owned by it’s respective poster?

  5. Hi, I got around the error:

    Warning: getimagesize() [function.getimagesize]: Filename cannot be empty in /home/fruitbow/public_html/wp-content/plugins/user-submitted-posts/user-submitted-posts.php on line 280

    Warning: Cannot modify header information - headers already sent by (output started at /home/fruitbow/public_html/wp-content/plugins/user-submitted-posts/user-submitted-posts.php:280) in /home/fruitbow/public_html/wp-includes/pluggable.php on line 890

    by adding this line of code:

    if((count($fileData['tmp_name'][$i]) > 0) && ($fileData['tmp_name'][$i] != '')){

    Find this line of code in user-submitted-posts.php:

    for ($i = 0; $i < count($fileData['name']); $i++) {
    Add the new code after this line

    Find this line:

    if ($imageCounter == $settings['max-images']){ break;
    }

    After this code add:
    }

    An example of this form functioning can be found by visiting: http://www.wpinsite.com/contribute

    Thanks for an awesome plugin

  6. I would love to use this, but I’m wondering how secure is it (spam, etc.)?

  7. i think it’s good for guest posting

  8. I was wondering if a user can copy-paste YouTube Embed text into the field and will it later work? Or is there a way to handle this?

  9. Hi
    this plugin works like a charme for me,
    but I need it in another language, how can I translate this and is it possible to show the min height or min width for images near the uploadbutton?

    thanks Monika

  10. sriganesh.M 2011/02/28 6:59 am

    Hi , thanks for the Plugin!
    -=-=-=
    Can we use this to publish as a user submitted links in a page and not in a post.
    I mean to say work like a Community news section. i watn the user to submit with email and when i approve it should apper in a single page(not in homepage or post).

    any help ?

  11. i installed your plugin and I was able to get the submit form to appear on the page i wanted. However, during my test post the image I selected does not show up in the post. What can I do to fix this?

    I am using wordpress 3.1

    Thanks.

  12. My ‘post content’ box is limited to a certain height/size, and I may have users inputting long chunks of text. How do I make it unlimited?

    • Jeff Starr 2011/03/01 4:27 pm

      Add a height:500px declaration to the plugin’s CSS file, located at /resources/user-submitted-posts.css. Add it to this selector:

      #usp textarea#user-submitted-content

      Then change the 500px to whatever you prefer.

      • Hey Jeff, Thanks for the reply. Unfortunately, I had already played with those values. What I am trying to do is get an unlimited area, which means when the user hits the bottom of the content area and tries to keep going, a scroll bar appears (or something less complicated) occurs.

        Any guidance would be appreciated. Thanks again Jeff.

      • Jeff Starr 2011/03/01 6:33 pm

        My pleasure Jeff. I would maybe try adding overflow:auto to the same selector. That tells browsers to add the scrollbar when the number of lines exceeds the vertical space. I think that should do it, let me know if not.

Comments are closed for this post. Something to add? Let me know.
Welcome
Perishable Press is operated by Jeff Starr, a professional web developer and book author with two decades of experience. Here you will find posts about web development, WordPress, security, and more »
WP Themes In Depth: Build and sell awesome WordPress themes.
Thoughts
I live right next door to the absolute loudest car in town. And the owner loves to drive it.
8G Firewall now out of beta testing, ready for use on production sites.
It's all about that ad revenue baby.
Note to self: encrypting 500 GB of data on my iMac takes around 8 hours.
Getting back into things after a bit of a break. Currently 7° F outside. Chillz.
2024 is going to make 2020 look like a vacation. Prepare accordingly.
First snow of the year :)
Newsletter
Get news, updates, deals & tips via email.
Email kept private. Easy unsubscribe anytime.