Title: preventing theme javascripts from loading on wp-login.php
Last modified: August 20, 2016

---

# preventing theme javascripts from loading on wp-login.php

 *  [Magi182](https://wordpress.org/support/users/magi182/)
 * (@magi182)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/preventing-theme-javascripts-from-loading-on-wp-loginphp/)
 * I am having a problem after the most recent update to Version 3.3.1. I have the
   following code as part of my theme’s functions.php
 *     ```
       function init_scripts() {
   
       	$jsurl = get_bloginfo('template_directory') . '/js';
   
       	wp_enqueue_script('jquery');
   
       	if ( !is_admin() ) {
       		wp_register_script(
       			'formlabels',
       			$jsurl . '/jquery.formlabels.js',
       			array('jquery'),
       			'1.0' );
       		wp_register_script(
       			'showhide',
       			$jsurl . '/jquery.show-hide.js',
       			array('jquery'),
       			'1.0' );
       		wp_enqueue_script('formlabels');
       		wp_enqueue_script('showhide');
       	}
       }    
   
       add_action('init', 'init_scripts');
       ```
   
 * In the past, this !is_admin() has prevented the two scripts from loading on the
   admin pages. Since the update, the scripts are now loading on wp-login.php, and
   the formlabels script is messing up the login form.
 * Suggestions to prevent these scripts from being enqueued on wp-login.php?

Viewing 1 replies (of 1 total)

 *  Thread Starter [Magi182](https://wordpress.org/support/users/magi182/)
 * (@magi182)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/preventing-theme-javascripts-from-loading-on-wp-loginphp/#post-2592203)
 * nevermind. Fixed it. The add_action line should have read:
 *     ```
       add_action('wp_enqueue_scripts', 'init_scripts');
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘preventing theme javascripts from loading on wp-login.php’ is closed 
to new replies.

## Tags

 * [javascripts](https://wordpress.org/support/topic-tag/javascripts/)
 * [wp_enqueue_script](https://wordpress.org/support/topic-tag/wp_enqueue_script/)

 * 1 reply
 * 1 participant
 * Last reply from: [Magi182](https://wordpress.org/support/users/magi182/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/preventing-theme-javascripts-from-loading-on-wp-loginphp/#post-2592203)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
