You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

迁移至虚拟主机后WordPress仪表盘无法显示(疑似数据库问题)

Fixing WP Admin Bar Site Name Menu Not Loading After Migration

Hey there, let's troubleshoot this frustrating issue where your wp-admin bar's site name won't show the dropdown menu (Dashboard, Pages, Widgets, etc.) when you hover or click it post-migration to your virtual host. Here are the most effective fixes to try, ordered by how common the issue is:

1. Double-Check Your Site URL Settings

This is the #1 culprit after migrations—your site might still be referencing local URLs in the database:

  • Log into wp-admin directly by visiting your-site-url.com/wp-admin (even if the menu is broken)
  • Navigate to Settings > General
  • Ensure both WordPress Address (URL) and Site Address (URL) are set to your live virtual host URL (not localhost or your local machine's IP)
  • Save changes, then do a hard refresh of the admin page (Ctrl+Shift+R on Windows/Linux, Cmd+Shift+R on Mac) to clear browser cache

2. Clear All Caches

Old cached data can block the admin bar's functionality:

  • Browser Cache: Use the hard refresh shortcut mentioned above to bypass cached files
  • WordPress Caching Plugins: If you use a plugin like WP Rocket or LiteSpeed Cache, go to its settings and clear all cache. If you can't access the settings, rename the plugin's folder via FTP (e.g., wp-content/plugins/wp-rocket → wp-content/plugins/wp-rocket-temp) to disable it temporarily
  • Server-Level Cache: Many hosts include built-in caching (like SiteGround's SG Optimizer). Check your host's control panel to clear this cache

3. Diagnose JavaScript Conflicts

A broken JS file can prevent the dropdown from triggering:

  • Enable Debug Mode: Add these lines to your wp-config.php file (via FTP or your host's file manager) to log errors:
    define('WP_DEBUG', true);
    define('WP_DEBUG_LOG', true);
    define('WP_DEBUG_DISPLAY', false);
    
    Check the wp-content/debug.log file for JS-related errors pointing to themes or plugins
  • Disable Plugins/Themes:
    • Rename the wp-content/plugins folder to wp-content/plugins-disabled via FTP. If the admin bar works, rename it back and re-enable plugins one by one to find the conflicting one
    • Switch to a default theme (like Twenty Twenty-Four) via Appearance > Themes. If the issue resolves, your custom theme has a conflict

4. Correct File Permissions

Incorrect permissions after migration can stop admin bar assets (JS/CSS) from loading:

  • Connect to your site via FTP or file manager
  • Set these permissions:
    • Folders: 755
    • Files: 644
    • wp-config.php: 600 (for extra security)
  • Most FTP tools let you bulk-apply permissions—right-click the wp-admin, wp-includes, and wp-content folders to update them

5. Re-Upload Core WordPress Files

Corrupted core files during migration can cause odd admin issues:

  • Download a fresh copy of the latest official WordPress version
  • Extract the zip, then delete the wp-content folder and wp-config-sample.php from the fresh files
  • Upload the remaining files (wp-admin, wp-includes, and root files like index.php) to your host via FTP, overwriting existing files. This won't affect your themes, plugins, or database

If none of these work, open your browser's developer console (press F12, go to the Console tab) and look for specific error messages—those will give you a precise clue about what's broken.

内容的提问来源于stack exchange,提问作者AbhiAbzs

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 06:35:02