Title: How to exclude wp-login.php from loading scripts
Last modified: August 19, 2016

---

# How to exclude wp-login.php from loading scripts

 *  [Mal](https://wordpress.org/support/users/looimaster/)
 * (@looimaster)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/how-to-exclude-wp-loginphp-from-loading-scripts/)
 *     ```
       if ( !is_admin() ) { // instruction to only load if it is not the admin area
       something to load
       }
       ```
   
 * This doesn’t work on wp-login.php page. How do I exclude it too?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Curtiss Grymala](https://wordpress.org/support/users/cgrymala/)
 * (@cgrymala)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/how-to-exclude-wp-loginphp-from-loading-scripts/#post-1979948)
 * I’m sure there’s probably a better way, but the only way I’ve been able to do
   so is to check the request URI, like this:
 *     ```
       if( !is_admin() && !stristr( $_SERVER['REQUEST_URI'], 'wp-login' ) ) {
       something to load
       }
       ```
   
 *  Thread Starter [Mal](https://wordpress.org/support/users/looimaster/)
 * (@looimaster)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/how-to-exclude-wp-loginphp-from-loading-scripts/#post-1979999)
 * Thanks 🙂
    I’m not sure if it’s going to work with some servers that use something
   like: a) localhost:8080 b) example.com/sub-dir/ c) abc.example.com/~x/ because
   I used $_SERVER variable a few times and it was often causing problems on untypical
   server configurations.
 * I’m going to experiment with some similar alternatives though if no one else 
   will come up with any better solution 🙂 Thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘How to exclude wp-login.php from loading scripts’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Mal](https://wordpress.org/support/users/looimaster/)
 * Last activity: [15 years, 1 month ago](https://wordpress.org/support/topic/how-to-exclude-wp-loginphp-from-loading-scripts/#post-1979999)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
