Allow public to post on blog

I need public users to be able to submit posts, then have them be approved by a moderator or admin on the dashboard. Is this possible to do? I would like it to function very similarly to comments.

for example, users will post their own stories and then a moderator will approve it being posted.

Read More

I am new to this particular stackexchange (I use stackoverflow often) and wordpress development, so forgive me if this seems like a stupid question.

Related posts

Leave a Reply

2 comments

  1. If you don’t want to give users access to the WordPress admin screens and you don’t want to use a premium plugin, you should create a form in a page and use wp_insert_post with the submitted data.

    In your case, the “post_status” parameter could be used to “moderate”:

    $post = array(
        'post_title'   => $_POST['title_field'],
        'post_content' => $_POST['content_field'],
        'post_status'  => [ 'draft' | 'publish' | 'pending'| 'future' | 'private' | custom registered status ] //Set the status of the new post.
    );
    
    wp_insert_post($post);
    

    The wp_insert_post function should take care of sanitizing the data before inserting it into the DB, but I recommend to double check and add filters if necessary.