Title: wp_register_script called incorrectly
Last modified: August 20, 2016

---

# wp_register_script called incorrectly

 *  [Joe Banks](https://wordpress.org/support/users/joenasagrc/)
 * (@joenasagrc)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/wp_register_script-called-incorrectly/)
 * PHP error found with this plugin installed and (from what I see) not tying wp_enqueue_script
   to an action.
 * Notice: wp_register_script was called incorrectly. Scripts and styles should 
   not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts,
   or init hooks. Please see Debugging in WordPress for more information. (This 
   message was added in version 3.3.) in /usr/appl/wordpress/wp-includes/functions.
   php on line 2758
 * To fix, reference this [https://codex.wordpress.org/Function_Reference/wp_register_script](https://codex.wordpress.org/Function_Reference/wp_register_script)
 * Plus here’s an example in reference to wp_enqueue_script
 *     ```
       add_action('wp_enqueue_script','register_my_scripts');
       function register_my_scripts(){
       wp_register_script('xxx');
       }
       ```
   
 * I’ll work on it myself as time permits.
 * [http://wordpress.org/extend/plugins/insert-javascript-css/](http://wordpress.org/extend/plugins/insert-javascript-css/)

The topic ‘wp_register_script called incorrectly’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/insert-javascript-css.svg)
 * [Insert JavaScript and CSS](https://wordpress.org/plugins/insert-javascript-css/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-javascript-css/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-javascript-css/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-javascript-css/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-javascript-css/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-javascript-css/reviews/)

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [Joe Banks](https://wordpress.org/support/users/joenasagrc/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/wp_register_script-called-incorrectly/)
 * Status: not resolved