Store data in custom fields from a form in a page


I have created a custom post typeservices’ with rohit such as ‘payment’,‘location’,‘rating’.
Now i need to create a form in the index page and upon the submission of form it store all data to the ‘services’ post type with custom fields which is same as in the form .

How do i acheive this .
Thanks for the help :slight_smile:

(Jason) #2

Hi @rohitsthaa

First, I’m not sure if this violates the terms and conditions of WP Chat which states this isn’t a place for simple support, but you are asking something a bit more technical so I’ll let @leland determine whether this is ok.

To my knowledge there’s no automatic way of doing this in WordPress. You’d have to build the form and then create the endpoint to handle the request and sanitize, validate, and create the new post. There are plugins out there, however, that can help with this such as Gravity Forms + Custom Post Types and Piklist. To be sure there are many others as well.

I’d start by checking into those sorts of options.

Hope this helps! :slight_smile:


i am really sorry if this violates the term and condition of WP chat. thank you for answer. I have just started to learn wordpress development.So, this just struck in my mind . Anyways thank you :slight_smile:

(Leland Fiegel) #4

It’s fine! Don’t worry about it.

That’s more for things like “how do I make a page” type stuff…I’d consider this a step above basic.

(Usman Shahzad) #5


You can easily do this using ACF or Formidable.