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 can I insert wordpress login screen on a different domain?

You can add the static form code to your main site’s code (your domain in this case is example.com and your subdomain is sub.example.com):

<form name="loginform" id="loginform" action="https://sub.example.com/wp-login.php" method="post">
            <p>
                <label for="user_login">Username or Email Address</label>
                <input type="text" name="log" id="user_login" class="input" value="" size="20" autocapitalize="off">
            </p>

            <div class="user-pass-wrap">
                <label for="user_pass">Password</label>
                <div class="wp-pwd">
                    <input type="password" name="pwd" id="user_pass" class="input password-input" value="" size="20">
                    <button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-toggle="0" aria-label="Show password">
                        <span class="dashicons dashicons-visibility" aria-hidden="true"></span>
                    </button>
                </div>
            </div>
                        <p class="forgetmenot"><input name="rememberme" type="checkbox" id="rememberme" value="forever"> <label for="rememberme">Remember Me</label></p>
            <p class="submit">
                <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="Log In">
                                    <input type="hidden" name="redirect_to" value="https://sub.example.com/wp-admin/">
                                    <input type="hidden" name="testcookie" value="1">
            </p>
        </form>

The hidden redirect_to input field tells WP where it will redirect upon successful login (wp-admin/ will have you end up in the dashboard).

The form however will not look like it does in WordPress due to the missing style. You can either add the WP login.css to your main site’s code

<link rel="stylesheet" id="login-css" href="https://sub.example.com/wp-admin/css/login.css?ver=5.3.2" type="text/css" media="all">

or just style it the way you like.

Related Posts:

  1. Check for correct username on custom login form
  2. Is it possible to sign in with user_email in WordPress?
  3. My login form does not work
  4. Change register form action url
  5. How can i add validation to this login form with out it redirecting to the wp-login.php page
  6. How can I do a URL redirection when an user uses wrong login details?
  7. How to modify the action attribute of the wp-login.php?action=register form?
  8. Redirecting after login?
  9. Sidebar login widget with error print, returns an error
  10. Change default login auth
  11. WordPress registration page template
  12. How to post frontend login form to a different authentication script from wp-login?
  13. wp_signon works localhost but not wokrs https site
  14. How to Create a login for for subscribers only
  15. How can I customize the content of the login page?
  16. authenticate to another site using a login form on my site
  17. In Django, how do I know the currently logged-in user?
  18. Can I programmatically login a user without a password?
  19. Can’t log in: “ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”
  20. Is there any way to rename or hide wp-login.php?
  21. How to login with email only no username?
  22. How can I redirect user after entering wrong password?
  23. Increase of failed login attempts, brute force attacks? [closed]
  24. Login page ERROR: Cookies are blocked due to unexpected output
  25. Separate registration and login for different roles
  26. SSO / authentication integration with external ‘directory service’
  27. Preventing session timeout
  28. How reduce wordpress login session timeout time?
  29. How to prefill WordPress registration with social details
  30. Disallow user from editing their own profile information
  31. I can’t access my site via wp-admin
  32. ‘Password field is empty’ error when using autofill in Chrome
  33. Removing username from the ‘wordpress_logged_in’ cookie
  34. How to show ‘login error’ and ‘lost password’ on my template page?
  35. What is $interim_login?
  36. Custom login form
  37. How to prefill the username/password fields on the login page
  38. wp_signon returns user, but the user is not logged in
  39. Adding extra authentication field in login page
  40. Prevent wp_login_form() from redirecting to wp-admin when there are errors
  41. Redirect user using the ‘wp_login_failed’ action hook if the error is ’empty_username’ or ’empty_password’
  42. wp_signon() does not authenticate user guidance needed
  43. What exactly is ReAuth?
  44. What are the differences between wp_users and wp_usermeta tables?
  45. Login members using web services
  46. Make my wordpress blog remember my login “forever”
  47. How to check in timber if user is loggedin?
  48. How do I change the language of only the login page?
  49. Disable WordPress 3.6 idle logout / login modal window / session expiration
  50. Stop WordPress from logging me out (need to keep me logged in)
  51. Woocommerce registration page [closed]
  52. How to disable autocomplete on the wp-login.php page
  53. Share login data/cookies between multiple installations
  54. Synchronize WordPress user accounts across multiple domains and installations without using WordPress MU
  55. How to pass users back and forth using session data?
  56. How do I change the logo on the login page?
  57. Why does WordPress hide the reset password key from the URL?
  58. How to use current_user_can()?
  59. Avoid to load default WP styles in login screen
  60. WordPress registration message
  61. How to fake a WordPress login?
  62. how to display the wordpress login and register forms on a page?
  63. Does wp_logout_url() destroy a session? (Logging out question)
  64. How can I send a welcome email to a user AFTER they login for the first time?
  65. Can not login with correct username and password
  66. Website Visible only to Registered users
  67. How can i increase the login expiration length?
  68. How do I use add_action from a class method?
  69. How to remove the WordPress logo from login and register page?
  70. How can I add a custom script to footer of login page?
  71. Brute force attack?
  72. Customize wp_new_user_notification_email()
  73. Need to execute a cron job
  74. Login email after registration never sent or received
  75. How can I create a separate blog that is private?
  76. How to keep always logged in development environment
  77. Add Confirm Password field in wp-login.php Password Reset page
  78. Integrate recaptcha and wp_signon – what is needed?
  79. Stop users from logging in from multiple locations
  80. I want to disable E-Mail verifcation / activation when a user signs up for my WordPress site
  81. custom login page redirect to logged in user profile page
  82. Email address or username used to login in wordpress
  83. How do I check if a post is private?
  84. Front-end login: Redirect user to the post they had created
  85. Receiving “This content cannot be displayed in a frame” error on login page
  86. Programmatically log in a wordpress user
  87. Action wp_login_failed not working if only one field is filled out
  88. Getting “Cookies are blocked or not supported by your browser” on login page
  89. What is the purpose of logging out after WordPress upgrade?
  90. Is it alright for two people to simultaneously be logged into a WP site as administrator?
  91. wp-login.php redirecting to HTTPS
  92. Display last login time
  93. How to customise wp-login.php only for users who are setting a password for the first time?
  94. Intentionally Force Failed Login WordPress
  95. How do I turn off the ability to login?
  96. Gaining Login Access via the Database
  97. How can I test the login for an expired session?
  98. Give visitor access to password protected page/post via external script
  99. Send reset password link to user from custom lost password form
  100. What hooks should I use for pre-login and pre-registration actions?
Categories login Tags forms, login
Add a Comment on/off option in Screen Options for Comments?
Change default values of Gallery Block settings

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