Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a website that I am working on. I created an html form and put in some code that will take the form data and create a new wordpress post. It will post the information to a specific category. All is working.

Now I want to know what I can do to protect the data being entered? Should I use php and write pregmatch statements for every input? I have 7 different inputs on my form. I was thinking that wordpress would already have some functions that I could use to validate the data to make sure someone isn't trying any bad things with my form. The users who will fill out this form will not be registered or logged in.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Take a look at WordPress codex Data Validation entry, it covers most of the validation functions that come built-in with WordPress which you can use to validate your form submission.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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