Search code examples
wordpressuser-roles

Submit posts from users without wordpress panel


I want to create a system that users can submit posts . For that , i changed the users role to the contributor . And it's perfect , users can submit the posts . But i don't like to users can access the wordpress panel . I want to users submit their posts from custom user profile in theme . Is there any function or trick that i do it ?


Solution

  • There are 2 ways to do this: Method 1:

    There are certain plugins that you can use to accomplish the task. 
    The below is an example:
    https://wordpress.org/plugins/user-submitted-posts/screenshots/
    

    Method 2:

    You too can achieve this functionality by writing a piece of code that will insert the data in the posts table. for that you have to create a page template and create a form for that template and write code that will work on submit of the form.
    Make sure the form data gets inserted into the posts table.