0

hi
today my wordpress blog in wp-admin and wp-login.php had an error

Notice: wp_deregister_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.) in /home/sedabaran/public_html/wp-includes/functions.php on line 4196

Notice: wp_deregister_script was called incorrectly. Do not deregister the jquery script in the administration area. To target the front-end theme, use the wp_enqueue_scripts hook. Please see Debugging in WordPress for more information. (This message was added in version 3.6.0.) in /home/sedabaran/public_html/wp-includes/functions.php on line 4196

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 login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.) in /home/sedabaran/public_html/wp-includes/functions.php on line 4196

Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.) in /home/sedabaran/public_html/wp-includes/functions.php on line 4196

Warning: Cannot modify header information - headers already sent by (output started at /home/mywebsite/public_html/wp-includes/functions.php:4196) in /home/mywebsite/public_html/wp-login.php on line 423

Warning: Cannot modify header information - headers already sent by (output started at /home/mywebsite/public_html/wp-includes/functions.php:4196) in /home/mywebsite/public_html/wp-login.php on line 436

Warning: Cannot modify header information - headers already sent by (output started at /home/mywebsite/public_html/wp-includes/functions.php:4196) in /home/sedabaran/public_html/wp-includes/pluggable.php on line 948

Warning: Cannot modify header information - headers already sent by (output started at /home/mywebsite/public_html/wp-includes/functions.php:4196) in /home/mywebsite/public_html/wp-includes/pluggable.php on line 949

Warning: Cannot modify header information - headers already sent by (output started at /home/mywebsite/public_html/wp-includes/functions.php:4196) in /home/mywebsite/public_html/wp-includes/pluggable.php on line 950

Warning: Cannot modify header information - headers already sent by (output started at /home/mywebsite/public_html/wp-includes/functions.php:4196) in /home/mywebsite/public_html/wp-includes/pluggable.php on line 951

Warning: Cannot modify header information - headers already sent by (output started at /home/mywebsite/public_html/wp-includes/functions.php:4196) in /home/mywebsite/public_html/wp-includes/pluggable.php on line 952

Warning: Cannot modify header information - headers already sent by (output started at /home/mywebsite/public_html/wp-includes/functions.php:4196) in /home/mywebsite/public_html/wp-includes/pluggable.php on line 953

Warning: Cannot modify header information - headers already sent by (output started at /home/mywebsite/public_html/wp-includes/functions.php:4196) in /home/mywebsite/public_html/wp-includes/pluggable.php on line 956

Warning: Cannot modify header information - headers already sent by (output started at /home/mywebsite/public_html/wp-includes/functions.php:4196) in /home/mywebsite/public_html/wp-includes/pluggable.php on line 957

Warning: Cannot modify header information - headers already sent by (output started at /home/mywebsite/public_html/wp-includes/functions.php:4196) in /home/mywebsite/public_html/wp-includes/pluggable.php on line 960

Warning: Cannot modify header information - headers already sent by (output started at /home/mywebsite/public_html/wp-includes/functions.php:4196) in /home/mywebsite/public_html/wp-includes/pluggable.php on line 961

Warning: Cannot modify header information - headers already sent by (output started at /home/mywebsite/public_html/wp-includes/functions.php:4196) in /home/mywebsite/public_html/wp-includes/pluggable.php on line 962

Warning: Cannot modify header information - headers already sent by (output started at /home/mywebsite/public_html/wp-includes/functions.php:4196) in /home/mywebsite/public_html/wp-includes/pluggable.php on line 963

Warning: Cannot modify header information - headers already sent by (output started at /home/mywebsite/public_html/wp-includes/functions.php:4196) in /home/mywebsite/public_html/wp-includes/pluggable.php on line 966

Warning: Cannot modify header information - headers already sent by (output started at /home/mywebsite/public_html/wp-includes/functions.php:4196) in /home/mywebsite/public_html/wp-includes/pluggable.php on line 967

Warning: Cannot modify header information - headers already sent by (output started at /home/mywebsite/public_html/wp-includes/functions.php:4196) in /home/mywebsite/public_html/wp-includes/pluggable.php on line 968

Warning: Cannot modify header information - headers already sent by (output started at /home/mywebsite/public_html/wp-includes/functions.php:4196) in /home/mywebsite/public_html/wp-includes/pluggable.php on line 969

Warning: Cannot modify header information - headers already sent by (output started at /home/mywebsite/public_html/wp-includes/functions.php:4196) in /home/mywebsite/public_html/wp-includes/pluggable.php on line 972

How can I fix this error note that i cant login to the site thanks alot

6
  • Have you recently attempted to add to add some JavaScript to your site with wp_enqueue_script? Feb 20 '19 at 11:59
  • @JacobPeattie i dont think so .but 3 person are working on this website . maybe others do something
    – meysam
    Feb 20 '19 at 12:01
  • but i should fix this error :(
    – meysam
    Feb 20 '19 at 12:02
  • Investigate with them before asking. In the future disable Theme Editor, Plugin Editor and disallow plugin activation/deactivation for anybody who is not administrator.
    – Max Yudin
    Feb 20 '19 at 12:07
  • @MaxYudin thanks.. OK i will do this in future. but now how can I fix this error?
    – meysam
    Feb 20 '19 at 12:11
1

The main cause of this error is that somewhere on your site, it could be your theme or a plugin, someone has incorrectly used certain functions.

The error messages themselves describe the problem perfectly well:

  1. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks.
  2. Do not deregister the jquery script in the administration area. To target the front-end theme, use the wp_enqueue_scripts hook.

All the other errors are caused just because the first 4 error messages were output early, and will go away when the first 4 are resolved.

This means that somebody has added code for enqueueing and dequeueing scripts that probably looks a lot like this:

wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', 'some/url/here', ...);
wp_enqueue_script( 'jquery' );

The cause of the errors is that these functions have apparently just been to functions.php or a plugin file without being properly hooked.

At the very least, it needs to look like this:

function wpse_329345_bad_jquery_nonsense() {
    wp_deregister_script( 'jquery' );
    wp_register_script( 'jquery', 'some/url/here', ...);
    wp_enqueue_script( 'jquery' );
}
add_action( 'wp_enqueue_scripts', 'wpse_329345_bad_jquery_nonsense' );

The first place I'd look for the problematic code (if other people are working on the site) is the bottom of the functions.php file in your theme directory. If you find it, make the change you can see I've made in my example (or delete it because you should not be enqueueing your own jQuery). That should resolve the issue.

All that being said. These are only debugging messages intended to inform the developer that they have done something wrong. These are appearing because you have debugging enabled on your site. If your site is live, you should not have visible debugging messages enabled. You can do this by disabling WP_DEBUG. The instructions for enabling it are here. Follow those but set the value to false instead of true to disable it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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