Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

How to modify the action attribute of the wp-login.php?action=register form?

You should be able to hook into the register_form_validation hook (which may be the same hook you’re already using. I’m just not sure where they do the validation) and add something like:

function my_register_validation() {
if(isset($_GET['ref'])){ 
   header('Location: http://www.example.com/wp-login?action=register&ref=$_GET[ref]');

}
add_filter(' my_register_validation', 'register_form');

I think that is the right idea the code above is untested but I think it gets you on the right track.

You said you were adding it to a secret form value so you might be able to use $_POST['secret_value'] instead.

Related Posts:

  1. Change register form action url
  2. Custom login and registration forms
  3. WordPress registration page template
  4. WordPress and Magento: let WordPress manage user registration and logins?
  5. Separate registration and login for different roles
  6. SSO / authentication integration with external ‘directory service’
  7. How to prefill WordPress registration with social details
  8. Check for correct username on custom login form
  9. Adding extra authentication field in login page
  10. Woocommerce registration page [closed]
  11. Is it possible to sign in with user_email in WordPress?
  12. WordPress registration message
  13. How can i increase the login expiration length?
  14. How do I use add_action from a class method?
  15. How to remove the WordPress logo from login and register page?
  16. Login email after registration never sent or received
  17. I want to disable E-Mail verifcation / activation when a user signs up for my WordPress site
  18. How do I check if a post is private?
  19. Receiving “This content cannot be displayed in a frame” error on login page
  20. My login form does not work
  21. Action wp_login_failed not working if only one field is filled out
  22. How to customise wp-login.php only for users who are setting a password for the first time?
  23. What hooks should I use for pre-login and pre-registration actions?
  24. wp_login action hook not working
  25. Is there any good tutorial to write custom login, registration and password recovery forms? [closed]
  26. Problem with logging in WP users automatically
  27. Is it possible a one click user registration with Facebook or Twitter (or other Social Networks)?
  28. How can i add validation to this login form with out it redirecting to the wp-login.php page
  29. Register/Login using only phone number?
  30. Force user to login in home page
  31. Force users to register in order to view website [duplicate]
  32. How do I force “users must be registered and logged in” on subsites?
  33. auto login after registeration for wp-members plugin
  34. How To Change Wp Register/Login URL Permanently To My Custom Page
  35. How can I do a URL redirection when an user uses wrong login details?
  36. Correct passwords keep appearing as incorrect
  37. How Can I Move Data From Form 1 To Form 2
  38. Disabling standard registration login with username/email and password?
  39. Login form doesn’t log in
  40. Get the url of custom login page in the registration page
  41. By registering always make uppercase the first letter of the login
  42. Show reCaptcha on Custom Frontend Login & Register Form [closed]
  43. Best option to implement external register/login to WP from self-made API
  44. Auto Login After Registration
  45. Disable all other page except index,register,login till user login
  46. easy steps to make front end form without plugin
  47. Redirecting after login?
  48. What speaks against using a custom login.php / register.php to wordpress?
  49. How do I add Login fields and registration link to the header?
  50. Sidebar login widget with error print, returns an error
  51. How to make a user be able to register if such a login already exists?
  52. How can I insert wordpress login screen on a different domain?
  53. add_action(‘init’) not work
  54. Change default login auth
  55. Sending new registration meta values to admin by email
  56. Reloading page with a query string upon login for admins
  57. Are login functions considered part of the WP backend?
  58. Removing “public” user registration without completely turning it off?
  59. Custom login modal page action
  60. Disable registration on certain condition
  61. what is the best and safest way to allow users to register to site
  62. Linking form to user meta fields
  63. How to change the login page without a plugin and not only customizing logo and text around the form?
  64. Updated : how to make email optional while user registration using default wordpress form
  65. How to post frontend login form to a different authentication script from wp-login?
  66. Problem in auto login after registration
  67. How to invalidate `password reset key` after being used
  68. wp_signon works localhost but not wokrs https site
  69. Check get_post value after wp-admin login
  70. Updating usermeta from login redirect to billing address
  71. How to Create a login for for subscribers only
  72. Chosen user password in registration is not being accepted on Login
  73. WordPress auto login user after registration only from a specific page
  74. User account activation links are lacking query strings
  75. How can I customize the content of the login page?
  76. Login user after registration programmatically
  77. Is there any reason why there’s no “login_header” action at the login page?
  78. How to get rid of the username of registration form in theme my login wp plugin?
  79. Custom user fields validation on registration
  80. Custom registration field to SQL database
  81. Where do I find “log in” and “register” link which are located on the top right corner?
  82. add unique code required to register
  83. How to force login after user browses for a few minutes or browses a few pages?
  84. Registration and Login form
  85. authenticate to another site using a login form on my site
  86. how to add custom word press regisration form in word press 3.5 with out module [closed]
  87. Click on banner to register to the blog
  88. How to put Login, Register and newsletter widget on the same page?
  89. make a login system for site visitors
  90. Redirect all pages to the custom login page except for the registration page
  91. How to create a fully functional user registration in WordPress?
  92. index.php file shown when trying to load wesite
  93. Init action and refresh page after form action
  94. Can I Get User ID at Login?
  95. autocomplete=”off” WordPress Login
  96. Cannot log into migrated site
  97. Custom code needed to be executed on login and logout
  98. Advanced WordPress plugin activation detection
  99. WordPress not logged in locally with correct username and password
  100. Woocommerce custom checkout form
Categories login Tags actions, customization, forms, login, user-registration
Pagination Comments Doesn’t Show
How to filter or remove the “title” attribute from category links

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress