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 change form action of wp-login page with a function

Follow standards instead of ugly solutions. Use WP filter (put inside functions.php):

add_filter( 'site_url', 'my_url_modifier', 10, 4 );

function my_url_modifier( $url, $path, $scheme, $blog_id)
{
    if($url=='http://mywebsite.com/wp-login.php?action=lostpassword')   
        return 'http://your_link..';
    else 
        return $url;
}

p.s. You should add other links there link example. Also, you can sanitise further parameters, like : if ($path=='wp-login.php')....

Related Posts:

  1. Refresh page after form action
  2. How to properly refresh page after form action?
  3. Init action and refresh page after form action
  4. Postback redirect through add_action is not triggered
  5. Sending Messages Back to the Template After Processing?
  6. remove_action on after_setup_theme not working from child theme
  7. Remove Actions/Filters added via Anonymous Functions
  8. Trying to use add_action and do_action with parameters
  9. Check if post is being published for the first time, or is an already published post being updated
  10. How to use the do_action () with parameter
  11. Perform an action when post is updated/published
  12. WordPress Theme Update Action?
  13. Extract image from content and set it as the featured image
  14. Relative URLs and hide /wp-content/themes/
  15. Do WordPress’ cron’s clean up expired transients?
  16. add_action in a function, is it possible?
  17. How can I get $id variable in widget’s form function?
  18. Using a private method as an action callback from within a class
  19. contactform7 remove tags with “wpcf7_autop false” from functions.php
  20. How to restrict actions and filters “properly” by conditions
  21. How to count number of functions attached to an action hook?
  22. Add action hook conditionally – only when home.php in use
  23. Using add_filter() in Widgets
  24. Add new user : make the fields First Name and Last name required
  25. Logout/login redirect CSS issue
  26. How to call WordPress functions from a form processing script
  27. How can I tell if I’m on a login page? [duplicate]
  28. what is the meaning of settings_fields()
  29. How do you permanently remove default rewrite rules from the wp_options table?
  30. Change meta tags programatically
  31. WP Login forms action URLs displayed as pretty URLs in browser (ex with Restore Password)
  32. Convert hyphen to underscore in permalinks
  33. Using get_terms for custom taxonomy in functions.php
  34. Fatal error: Call to undefined function add_action() – an untouched problem
  35. How to hook into the quick edit action?
  36. Reuse variable in hook callback
  37. update_post_meta for custom field not working upon form submission
  38. Call to undefined add_action() in theme’s functions.php
  39. WooCommerce add_action hook results in 500 error
  40. Automatically Add Specified Value to Attachment Metadata upon Upload
  41. Can’t Update function.php after writing short code
  42. How to update feed only 2-3 times a week (for Feedburner email)?
  43. WordPress registration and contact form 7 [closed]
  44. How would go about if I just want a temporary function?
  45. Passing arguments to my function with do_action and add_action is not working
  46. Pass parameters to function through an action
  47. How can I create a page with a specific URL?
  48. Accepted arguments value in hook functions
  49. How to select a page within admin?
  50. How to manage arrays from custom functions stored in functions.php?
  51. How do I pass arguments for multiple functions hooked to a single action?
  52. Which action hook to use for function?
  53. Gravity Forms – Using a Form to Pre-populate A Gravity Form [closed]
  54. Ninja form Redirect depending on text field content [closed]
  55. Load .txt file for login_message in wp-login.php
  56. Custom HTML in specific category single page and its descendant categories
  57. WordPress upload_mimes not working for front-end uploads of 3D files
  58. How to change login labels
  59. Ajax not working properly
  60. Modify a function without editing template
  61. Don’t delete a page if it holds users
  62. How do I add Bootstrap and LESS to my migrated WordPress site?
  63. Having a Function Inside of the Loop
  64. Which action does wp_update_user triggers?
  65. How to rewrite the custom url in wordpress?
  66. How can I get my Script to work on the Login page?
  67. Trigger a custom function when option are saved in admin area
  68. Removing wp_login_viewport_meta
  69. Removing custom meta data
  70. Is there an alternative to get_template_directory_uri()?
  71. Reuse variable in hook callback
  72. Wait a result before enqueue
  73. Redirect to another page if the user is logged in when pressing again the login button on menu bar
  74. meta tags doesnt fetch data from permalinks
  75. Multiple Loops Meta Data
  76. Function added using `add_action()` not being called
  77. Difference b/w Simple function call & do_action call
  78. jQuery does not work
  79. Override the WordPress core function wp_referer_field
  80. Set Taxonomy based on post status
  81. Is There Any Built In WP Functionality For Combining Form Fields To Return Specific Data
  82. Two functions with different arguments and add_actions, but identical code
  83. add_action template_redirect not working for home page
  84. I can’t seem to install Font Awesome locally [closed]
  85. AMP – Change rel=”canonical” from functions.php [closed]
  86. wp_nonce_field is breaking form for reasons unknown
  87. Scripts not loading when using the wp_enqueue_scripts action
  88. Is there a way to prevent a function/method from being called outside a specific hook?
  89. Auto-Tweet if Type is ‘Status’ using OAuth
  90. Missing argument for the function
  91. problem loading stylesheets to wp_head dynamically
  92. current_user_can comma list vs OR (||) list
  93. Page get parameter doesn’t work with is_single() function
  94. Adding code before post title with the_title produces weird results
  95. Add back in child theme what the parent theme removed with remove_action
  96. login_headertitle is deprecated since version 5.2.0
  97. How to rewrite wordpress search to work on specific category
  98. Contact Form 7 If Condition
  99. error at login page in wordpress
  100. 400 Bad Request – JavaScript App calling Custom wp-json endpoint
Categories functions Tags actions, forms, functions, url-rewriting, wp-login-form
How to redirect non-admin/editors from specific pages?
Admin metabox with custom post type dropdown option not update choosed input after saving

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