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

wp_login_form redirect problem

Your code contains a mistake in passing arguments to the wp_login_form() function. If you define the arguments after function then the function will be called with the default values, so your arguments will not have any effect. The correct code is below:

if (is_user_logged_in()) {               
    echo '<div class="logout"> <p>Hello!<div class="logout_user"> You are logged in and can proceed to the <a href="http://example.com/seminar">Online Seminar</a>.</div></p><br /><p><a id="wp-submit" class="logout" href="', wp_logout_url(), '" title="Logout">Logout</a></p></div>';
} else { 
    $args = array(
        'echo'           => true,
        'redirect'       => 'http://example.com/seminar',
        'label_log_in'   => __( 'Log in' ),
        'form_id'        => 'seminar-login',
        'label_username' => __( 'Username' ),
        'label_password' => __( 'Password' ),
        'label_remember' => __( 'Remember Me' ),
        'id_username'    => 'user_login',
        'id_password'    => 'user_pass',
        'id_submit'      => 'wp-submit',
        'remember'       => true,
        'value_username' => NULL,
        'value_remember' => true
    );
    wp_login_form($args); 
}

Related Posts:

  1. Custom login form redirect to external site
  2. Clarification on auth_redirect()
  3. How to redirect all requests to wp-login.php?
  4. Redirect user after login/registration globally
  5. Remove lost password form and URL
  6. What is the wordpress way of displaying local external content?
  7. How to auto login after registration? [duplicate]
  8. Change ‘Back To Website’ link in wp-login.php
  9. Redirect away from login page
  10. Redirect when accessing /login when logged in
  11. Show different page for first time user
  12. Redirect outside WP after login
  13. adding GET variables to a header() location in a page template
  14. How to redirect wp_login_form to new page after user loged in?
  15. redirect doesn’t work while using example code
  16. Disable redirect to homepage after successful Login, Stay on Current Page
  17. wp_login_form() redirect same page
  18. Determine user destination on wp-login.php
  19. Redirect after login when WordPress in subdirectory
  20. Redirect based on referer using Advanced Custom Fields
  21. Login redirects to home page and doesn’t log in
  22. Custom login-form redirect
  23. Login Form Redirection
  24. Redirect user to login and then to page where they came from
  25. Redirect after registration and auto login is not working
  26. PHP header(Location: …): Force URL change in address bar
  27. What does HTTP/1.1 302 mean exactly?
  28. php refresh current page?
  29. How to force a 404 on WordPress
  30. Disable front end to use as CMS only?
  31. Redirect Restricted Page to 404
  32. How to redirect non-logged in users to a specific page?
  33. How to prevent automatic redirection of 404 errors and “incorrect” URLs?
  34. How do I skip wordpress’s 404 handling and redirect all 404 errors for static files to 404.html?
  35. Disable WordPress URL auto complete
  36. Host the wp-admin on another domain?
  37. Redirect user to original url after login?
  38. Unable to login and wp-login.php redirects to wp-admin%2F&reauth=1?
  39. When I change slug, will WordPress create redirect from the old URL?
  40. WordPress localhost site redirect to live site
  41. WordPress redirecting connections on port 8080 to 80
  42. WordPress Redirect All HTTP requests to HTTPS via .htaccess
  43. wp_redirect() function is not working
  44. Redirect entire website to a single page
  45. My wordpress multisite homepage redirects to signup page
  46. Logout redirect to home page
  47. Disable ONLY URL auto complete, not the whole canonical URL system
  48. Redirect Localhost wordpress site to dashboard
  49. Redirect page URL to home URL without using a plugin
  50. Why is WordPress redirecting from http to https on a local environment?
  51. Login redirect to previous page
  52. How to prevent redirect to ‘About’ after core upgrade?
  53. 301 redirect instead of 404 when URL is a prefix of a post or page name?
  54. Why is wp_redirect() preferable to a standard PHP header redirect?
  55. How do I programmatically generate a 404?
  56. Redirect to referring page after logging in
  57. User redirect to destination URL after login
  58. Prevent access to single post types
  59. check first time login only
  60. How to change the default logout link on WordPress Admin
  61. Stop WordPress from “guessing” redirects for nonexistent URLs
  62. WordPress install enters an infinite loop
  63. How to redirect a sucessful registration to a page template?
  64. How to configure nginx to redirect requests to the uploads directory to the production server?
  65. WordPress HTTPS redirect loop
  66. Why am I getting a 301 on a existing post?
  67. Redirect to dashboard after login
  68. Make a video post redirect to next post after completion
  69. Old blog/ and blog/feed/ URLs not working after moving blog to top-level via .htaccess
  70. Non-WordPress page in subdirectory under WordPress page
  71. Force HTTPS using .htaccess – stuck in redirect loop
  72. How to redirect after login, the working way?
  73. Keeps on redirecting on my development copy
  74. Password change when the user login first time
  75. Redirecting WordPress /.htaccess / HSTS / SSL
  76. 301 redirect not working through .htaccess
  77. handling login/logout redirects
  78. Logout/login redirect CSS issue
  79. Site redirects to wrong url when saving settings
  80. Implementing global redirection (automatic redirect for all pages who had their slug changed)
  81. Correct way to hide pseudo pages from being shown?
  82. Redirect blog page to latest post?
  83. Redirect to custom url when registration fails?
  84. Why does WordPress automatically redirect URLs with the parameter “name=” to a different page?
  85. prevent/block direct access to a thank you page
  86. Redirect After Delete User in Backend
  87. Exclude a path from WordPress using .htaccess redirects (Apache)
  88. Restrict Access to wp-login.php
  89. How to hide/redirect the author page
  90. How to setup 301 redirects for multiple query string URLs?
  91. How to redirect url requests to https? [closed]
  92. Using `auth_redirect` : keeps asking me to login even when I’m logged in
  93. Htaccess redirect from ‘/%postname%.html’ to ‘/%postname%’
  94. Redirect to post after submission with Gravity Forms? [closed]
  95. How can I move/redirect single blog posts from one blog to another?
  96. Best way to handle redirects
  97. WordPress site redirects to different wordpress domain on the same server after reuploading db backup
  98. Redirecting old permalink to new one
  99. WP auto redirects after url change?
  100. Setting a redirect cookie in wordpress
Categories redirect Tags page-template, redirect, wp-login-form
WP_Query – Accessing MetaValue from Query Result
update_option_{$option} not showing old value

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