To avoid conflict I need to load the CSS and jquery explicitly for the login screen only and neither an admin nor on the frontend. Given that I have a custom login screen.

  • What does "I may also have a custom login screen as well" mean? Do you or don't you? How is it implemented? No one's going to be able to tell you how to loading something on a custom login screen if you don't explain what that is. Mar 1, 2019 at 12:15
  • If it needs to be confirmed, then I have. My bad.
    – uservs301
    Mar 1, 2019 at 12:19
  • And? How was it implemented? Mar 1, 2019 at 12:20
  • @Jacob Peattie By using the third party plugin for custom login URL change.
    – uservs301
    Mar 1, 2019 at 12:23
  • So you've only changed the URL to wp-login.php? You haven't created a separate login page or anything? Mar 1, 2019 at 12:25

1 Answer 1


You can load scripts and styles on the login page using the login_enqueue_scripts hook. You can use the same enqueue functions for scripts and styles that you'd use for other pages but they'll only load on the login page:

function wpse_330353_login_scripts() {
    wp_enqueue_script( 'handle', '//example.com/url/to/script.js' );
    wp_enqueue_style( 'handle', '//example.com/url/to/style.css' );
add_action( 'login_enqueue_scripts', 'wpse_330353_login_scripts' );

None of this would be affected by changing the URL of the login page.

  • Thank you. This seems to work. I forget it is available in WP. How stupid of me. :) But since I don't have enough reputation "with less than 15 reputation are recorded, but do not change the publicly displayed post score." You Know. But Thanks a lot. Answer accepted but no upvote for now.
    – uservs301
    Mar 2, 2019 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.