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:
- Scripts and styles should not be registered or enqueued until the
wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts
hooks. - 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.