Coding Tricks, How To Guides and Error Fixes
  • Home
  • How-To
  • CSS
  • PHP
  • WordPress
  • Contact
Coding Tricks, How To Guides and Error Fixes
  • Home
  • How-To
  • CSS
  • PHP
  • WordPress
  • Contact
Coding Tricks, How To Guides and Error Fixes
  • Home
  • How-To
  • CSS
  • PHP
  • WordPress
  • Contact
How-To • Wordpress

Adding Extra Authentication field in WordPress login page

Vishwas
Add Comment
    Share This!
  • Facebook
  • Twitter
  • Pinterest
  • LinkedIn
  • ReddIt
  • Email
  • StumbleUpon
  • WhatsApp
  • vKontakte

If you allow custom fields on your WordPress site, chances are you need to gather some more information about your customers or end-users. If you absolutely need some specific information, the best way to get it is to add it during wp-login, otherwise, there are narrow chances that your users will actually visit their profile page and provide that optional data.

Sure, there are more number of free and premium plugins that are already exist, but you may want to do it manually, either because the plugins don’t do accurately what you want, or because you want to keep your website as lightweight as much as possible. Yes, there are tutorials also that tell you how to do it, but my analysis tells me that they are incomplete. in this tutorial we are going to explain how to add extra authentication field in WordPress login page.

Let’s get started : 


add_action('login_form','my_added_login_field');
function my_added_login_field(){
//Output your HTML
?>
<p>
<label for="my_extra_field">My extra field<br>
<input type="text" size="20" class="input" name="my_extra_field_name"></label>
</p>
<?php
}

Paste the above code in active theme’s Functions.php or if you have Wp-snippets plugin you can create new snippet and add the above codes. After doing these changes goto wp-admin, you can see the changes.

If you have doubts or any conflicts please let us know by dropping your comment in the below comment box.

Happy Coding 🙂

Tagscustome field in login

You may also like

Drag and Drop
How-To • JQuery

Drag and Drop in JQuery

June 19, 2022
Best • Wordpress

5 Best WordPress Speed Optimization Plugins

April 24, 2022
How-To • Wordpress

How to use delete_user hook in WordPress

December 5, 2021

About the author

View All Posts

Vishwas

A coder who is trying to solve some problems via "Procoders", Software Engineer By Profession, WEB Enthusiast, Hobby Blogger. I love to share Tech Ideas and like to learn and explore new things and Technologies.

Add Comment

Click here to post a comment

Cancel reply

Best Login/Sign Up Forms
Best CSS animations
Comment
    Share This!
  • Facebook
  • Twitter
  • Pinterest
  • LinkedIn
  • ReddIt
  • Email
  • StumbleUpon
  • WhatsApp
  • vKontakte
  • 7 Best Visual Studio Code Extensions
  • Higher-Order Components In React
  • Best CSS Wave Animations
  • Drag and Drop in JQuery
  • 5 Best WordPress Speed Optimization Plugins
  • CSS Countdown Timers
  • Best Social Icons Free Download(50+ free Download)
  • How to use delete_user hook in WordPress
  • Swiping in jQuery
  • Session Storage & Local storage in JS

About Us

A ProcodersOnline.com is a nonprofit think tank for beginners, intermediates where you can post your queries as well as doubts to get optimized results. The main aim of this site is to provide quality tips, tricks, and hacks.

For business enquiries:

procoder.online[@]gmail.com

Categories

  • AWS
  • Best
  • CSS
  • How-To
  • JQuery
  • JS
  • PHP
  • Wordpress

App with ProCoders

#World’s Best GUID Generator
We have an unique feature(Export to CSV). This feature will help while generating multiple GUIDs for your projects.

Copyright © 2023. Procoders