WordPress 4.9.4后台JQuery无法加载,请求解决方法
Hey there, let's work through this jQuery loading issue in WordPress 4.9.4 admin panel—this is a super common problem, and I’ve fixed it more times than I can count. Here are the step-by-step fixes to try, ordered from easiest to more involved:
1. Rule Out Plugin/Theme Conflicts
First, let’s eliminate the most likely culprits:
- Disable all plugins: Head to Plugins > Installed Plugins, select all plugins, use the bulk actions dropdown to choose "Deactivate", then hit Apply. Refresh the admin panel and check if jQuery loads. If it does, reactivate plugins one by one until you find the one causing the conflict.
- Switch to a default theme: Temporarily activate a core theme like Twenty Seventeen (it’s fully compatible with 4.9.4). Custom themes often mess up script loading by incorrectly deregistering jQuery—if switching fixes the issue, your theme’s code is the problem.
2. Ensure WordPress Core is Loading jQuery Correctly
WordPress admin should load jQuery automatically, but some code might be breaking this:
- Check if your theme or plugins are using
wp_deregister_script('jquery')without properly re-registering a valid version. This is a huge red flag—any code that does this needs to be adjusted to use the core jQuery instead of a custom one (unless it’s absolutely necessary, which it rarely is for admin functionality). - If you suspect core jQuery isn’t being enqueued, add this snippet to your child theme’s
functions.php(or a custom plugin, to avoid losing changes when updating your theme):
function enforce_core_jquery_admin() { if (is_admin()) { // Force WordPress to load its core jQuery in admin wp_enqueue_script('jquery'); } } add_action('admin_enqueue_scripts', 'enforce_core_jquery_admin');
3. Fix File Permissions
Incorrect permissions on jQuery files can block the server from serving them:
- Connect to your site via FTP or cPanel File Manager, navigate to
wp-includes/js/jquery/. - Set the folder permissions to 755 and all files inside to 644. Most hosting control panels let you do this in bulk—just select the folder/files, use the permissions editor, and apply those values.
4. Clear All Caches
Cached old scripts are often the hidden culprit:
- Browser hard refresh: Press
Ctrl+Shift+R(Windows/Linux) orCmd+Shift+R(Mac) to bypass browser cache and reload the admin panel. - Server-side cache: If you use a plugin like WP Super Cache or W3 Total Cache, clear its cache from the plugin settings. Also check if your hosting provider uses a CDN or server cache—clear that through your hosting dashboard if applicable.
5. Manually Replace Corrupted jQuery Files (Last Resort)
If the core jQuery files are corrupted, replace them with fresh copies:
- Download the WordPress 4.9.4 archive from the official WordPress release archive.
- Extract the
wp-includes/js/jquery/folder from the zip. - Upload this folder to your server via FTP, overwriting the existing
wp-includes/js/jquery/folder. This ensures you have uncorrupted, core-approved jQuery files.
内容的提问来源于stack exchange,提问作者Mohammed Hamad
相关产品推荐
相关产品推荐

