Home » Wordpress » WordPress add custom field to registration form without plugin

WordPress add custom field to registration form without plugin

I’m going to show how to add custom field to user registration form in wordpress.I checked through the internet to add this custom field and how to validate that field for values.But couldn’t find useful articles. So I decided to show simple guide to how to add custom field to user registration form and how to validate it for values from simple step to advanced steps.So special thing is you don’t have to use any plugins for this.

Wordpress add custom filed to registration form without plugins

Step -1 : Add custom field to registration form

1-Find your current theme folder and it’s functions.php file.
2-Open that file, copy the following code and paste at the end of the page.

3-Save the file and go to register page and check for filed just now added.

Step -2 : Validate field for empty value

Here we need to do the validate process for empty value of we added filed.So do this copy the following function and add the end of the functions.hp file.

When you entered empty values then error message is like this.

Wordpress add custom filed to registration form without plugins Error page

That’s only.
In the next post I’ll show you how to how to add security question in to the registration form to stop spams.But it is without any plugins. 😉

If you have suggestions or ideas or problems, leave a comment bellow.

Tags

Similar posts