WordPress Permalinks Show 404 After a Site Migration
A migration-safe way to troubleshoot posts and pages that return 404 while the WordPress homepage still loads.
Quick answer
Resave permalinks, confirm Apache rewrite support, inspect .htaccess outside and inside the WordPress block, and check for custom post type slug conflicts before rebuilding content.
Problem, cause, fix, verify
Problem
Resave permalinks, confirm Apache rewrite support, inspect .htaccess outside and inside the WordPress block, and check for custom post type slug conflicts before rebuilding content.
Why it matters
Configuration, logs, status codes, and source-backed implementation details.
Safe check
Read logs and order notes
Verify
Avoid broad changes without a rollback path
Editorial trust
- Author
- WPlura Editorial Team
- Last reviewed
- Next review
- Sources
- 5 cited references
On this page
Technical reference
Check evidence before changing configuration
Configuration, logs, status codes, and source-backed implementation details.
The Problem
A common post-migration surprise is simple on the surface: the WordPress homepage loads, the dashboard may still work, but individual posts, pages, custom post types, or product URLs return 404. In many cases the content is still in the database. The request is failing before WordPress can match the pretty permalink to the right query.
That distinction matters during a migration. If the content exists, rebuilding pages or restoring an old backup is usually the wrong first move. The safer path is to check WordPress rewrite rules, Apache or host-level rewrite support, stale redirects, changed site URLs, and slug conflicts in a controlled order.
Check the Pattern Before Editing Files
- Test the homepage, a normal post, a page, a category archive, a custom post type URL, and the REST API index from a private browser session.
- Switch one affected URL to its plain query form, such as a post ID URL, to verify that WordPress can still load the content.
- Check Settings > General for the correct WordPress Address and Site Address after the move.
- Open Settings > Permalinks and note the current structure before saving anything.
- Review migration redirects, SSL redirects, CDN rules, and host panel redirects that may now overlap with WordPress routing.
Manual Fix Workflow
- Back up the current .htaccess file and any host-level redirect rules before editing.
- Open Settings > Permalinks and save once without changing the structure. This asks WordPress to flush and regenerate rewrite rules.
- If the site runs on Apache, confirm the .htaccess file exists in the WordPress directory and includes a normal WordPress rewrite block.
- Ask the host to verify that rewrite support and directory overrides are enabled for this virtual host when WordPress cannot write or honor .htaccess rules.
- Temporarily disable duplicated migration redirects that send old paths back into WordPress in a loop or to a stale directory.
- Check whether a page slug, custom post type slug, taxonomy base, or plugin route now collides after the migration.
- If the server is Nginx or a managed platform without .htaccess, use the host's WordPress permalink rule pattern instead of copying Apache rules.
Retest the same failing URLs after each step. If saving permalinks fixes the site, document the cause and stop. If the issue returns later, look for a plugin, deployment process, cache purge, or migration script that keeps rewriting rules or redirects after WordPress has already regenerated them.
Avoid repeated rewrite flushing as a permanent fix. WordPress exposes rewrite flushing for cases where rewrite rules need to be regenerated, but a site that needs constant flushing still has an ownership problem in a plugin, theme, deployment, or server rule.
How WPlura Helps
Web Plura Diagnostics helps WordPress admins turn a vague symptom into a more organized review. The goal is not to hide the underlying issue or promise an automatic repair. It gives the site owner a clearer local view of relevant signals, so the next troubleshooting step can be smaller and better documented.
Technical reference support tool
Web Plura Diagnostics
Free local diagnostics for site health, performance, plugin/theme impact, hosting, update risk, cron, front-end response, Fix First prioritization, support-safe snapshots, JSON/CSV exports, scheduled scans, and WP-CLI output.
What the 404 Pattern Tells You
The exact 404 pattern usually points to the layer that failed during migration. A homepage-only success usually means the web server can reach WordPress but rewrite routing is not matching internal URLs. A mix of 404s and redirects may point to stale migration rules. A single content type failing may point to a slug conflict or a custom post type that did not register its rewrite rules.
- Homepage works, posts fail: start with permalink flush, .htaccess rewrite block, and host rewrite support.
- Homepage and dashboard work, custom post type URLs fail: check whether the plugin or theme registering the post type is active and whether its slug now conflicts with a page.
- Old URLs redirect to the wrong domain or directory: review migration redirects, canonical host rules, SSL redirects, and CDN rules.
- Saving permalinks works only until the next deployment: check whether deployment scripts replace .htaccess or skip writable files.
- Only some categories or tags fail: review category base, tag base, multilingual routing, and taxonomy slug conflicts.
Likely Root Causes
Do not treat post-migration permalink 404s as proof that WordPress core is broken. The same symptom can come from several layers that all touch URL handling during a move.
- The .htaccess file was not copied, is not writable, or contains rules from the old server path.
- Apache rewrite support or directory override behavior changed on the new host.
- A plugin, security tool, or redirect manager added rules outside the WordPress rewrite block.
- The WordPress Address and Site Address no longer match the public canonical domain.
- A custom post type slug, page slug, category base, or tag base now conflicts with another route.
- Nginx or a managed host needs platform-specific rewrite rules, so Apache instructions never apply.
- A cache or CDN is serving an old 404 response after the underlying permalink issue is already fixed.
Use Diagnostics Without Guesswork
Web Plura Diagnostics is useful after the first permalink checks because it keeps the troubleshooting record local to WordPress. It does not promise to rewrite server rules for you. It helps collect adjacent signals that often decide where the next action belongs: WordPress admin, developer, host, DNS provider, or CDN support.
- Install the free Web Plura Diagnostics plugin from WordPress.org, activate it, and open Web Plura Diagnostics in wp-admin.
- Run Diagnostics before another live change so you have one local view of site health, hosting limits, cache hints, REST and front-end response, cron pressure, update risk, and email readiness.
- Read Fix First items for the problem, impact, owner, urgency, and next action rather than jumping between plugin screens.
- Use the support-safe snapshot, JSON export, or CSV export when you need to send a concise problem summary to a developer or hosting support.
- After the permalink repair, rerun the check and keep the before-and-after notes with the migration record.
- Use the WordPress.org plugin page as the installation reference: download the free plugin on WordPress.org
- Use the WPlura product page for product details and support context: WPlura product details
- Keep the final decision human-owned. Diagnostics can organize the evidence, but backups, staging, hosting support, and developer review still matter for business-critical migrations.
The free WordPress.org plugin is the primary CTA for this workflow: download the free plugin on WordPress.org. For broader product information, use WPlura. Keep product usage practical: install, activate, run the local check, review findings, export or document the result, then continue with the manual fix described in this guide.
Keep a Migration Repair Record
A permalink fix is only half-finished if nobody records why it worked. Migrations often involve multiple people, tools, and hosting layers. A short repair record keeps the same 404 from coming back during the next deploy, SSL change, cache purge, or redirect cleanup.
- List the exact URLs that failed and the URLs that were used for retesting.
- Record whether the site uses Apache .htaccess rules, Nginx rules, or a managed host rule editor.
- Save the final permalink structure, category base, and tag base.
- Note the redirect owner: WordPress plugin, host panel, CDN, or hand-written server config.
- Keep a copy of the working rewrite rules or host support response with the migration ticket.
- Document whether the final fix was a WordPress setting, a server setting, a slug change, or stale cache.
Prevent the Same Issue From Returning
- Keep redirects in one documented owner instead of splitting them across a plugin, host panel, CDN, and .htaccess without notes.
- Include permalink checks in every migration QA list: homepage, one post, one page, one category, one custom post type, feed, REST API index, and sitemap.
- Use staging for risky permalink structure changes on stores, membership sites, lead-generation sites, and client production sites.
- Keep backups and restore instructions ready before editing .htaccess, wp-config.php, theme files, plugin folders, or server rules.
- After migration, monitor crawl errors and analytics landing pages so hidden 404s are caught before search engines and visitors keep hitting them.
Good troubleshooting leaves the site easier to support next time. Keep the final fix, the source of the problem, the rollback option, and the owner of the setting in one short note that another admin can understand later.
References
References
- Customize permalinks - WordPress.org Documentation, accessed 2026-09-17
- Migrating WordPress - WordPress Developer Resources, accessed 2026-09-17
- .htaccess files - Apache HTTP Server Documentation, accessed 2026-09-17
- flush_rewrite_rules() - WordPress Developer Resources, accessed 2026-09-17
- Web Plura Diagnostics - Site Health, Email & Update Risk Advisor - WordPress.org Plugin Directory, accessed 2026-09-17
Frequently Asked Questions
Should I fix WordPress permalink 404s after migration directly on the live site?
Use the smallest safe change first. For a busy site, test on staging or during a quiet maintenance window before deactivating many plugins, switching themes, or editing server files.