How to fix Disorganized collapsed WordPress
Migrating a WordPress website can sometimes lead to a distorted, collapsed, or disorganized homepage. This is especially common when moving a site from a subdirectory or local development environment to the root domain. In this guide, I’ll walk you through how to rectify this issue effectively.
This fix is ideal for:
- Websites previously built in a subdirectory: E.g.,
https://www.exampledomain.com/demo
moved tohttps://www.exampledomain.com
. - Websites developed offline: E.g., websites designed on WAMP or XAMPP and then uploaded to the main domain.
Before the Fix
The Fix: Step-by-Step
Step 1: Update URLs in the WordPress Database
The most common cause of this issue is incorrect URLs in the database. To fix this:
- Access the WordPress Database: Log in to your hosting control panel (e.g., cPanel) and open phpMyAdmin.
- Find the Options Table: Navigate to the table called
options
. This table is typically prefixed with your database prefix, such aswpcg_options
. - Update URLs:
- Locate the following rows:
siteurl
home
- Edit these rows to reflect the correct domain you have migrated to. For example:
- From:
http://localhost/demo
- To:
https://www.exampledomain.com
- From:
- Locate the following rows:
Step 2: Clear Browser and WordPress Cache
Cached data can sometimes prevent updates from appearing. Clear your browser cache and, if you use caching plugins, clear your WordPress cache as well.
Step 3: Regenerate Permalinks
- Log in to your WordPress dashboard.
- Go to Settings > Permalinks.
- Without changing any settings, click Save Changes.
This refreshes your permalinks and resolves broken link issues.
After the Fix
Once you’ve updated the URLs and cleared your cache, your website should load correctly