WordPress Permalinks Not Working after Migration? Fixing the Problem

In WordPress by Fathi ArfaouiLeave a Comment

If you have moved your WordPress blog or website and found that the permalinks are not working again, then, don’t worry. That’s one of the most common problems when moving a WordPress blog to a new server, or even, to another web hosting provider.

It happens also when re-installing WordPress. You will notice that all your old posts redirect to 404 not found page errors.

In other cases, these posts will get an id instead of their post name. That’s a natural problem because your new server needs to rewrite the rules to execute your permalinks. Today, I will show you how to fix the WordPress permalinks after migration.

Before everything, please makes sure that you can login to cPanel and edit the files. In general, web hosting companies allow that. In the end, you need to edit your website files if something wrong happens. In other cases, hosting providers can limit the access for some security reasons, so, you can login, but, you can’t edit the file permissions, for example, and you need to contact the company to correct that issue.

How to reset WordPress permalinks

To fix the broken permalinks problem, you need to login to the WordPress admin (dashboard), and reset your permalinks by just clicking on ”Settings”, then, ”Permalinks”.

WordPress permalinks not working

Then, select your old permalinks setting, in general, it’s recommended to use “post-name” for blogs, and “day and name” for news and magazine websites. This is not a rule, but, remember that you have to save the same link structure for your blog.

If you add the ”category name” to your post link, for example, and want to change that later, you will lose your rank and this is what you don’t need in any case. So, use “post name”, it is clean and SEO friendly for search engines, but also, that looks easy and clean for people.

After selecting the right option, click on “Save Changes” button.

How to change permalinks in WordPress

That’s how to change permalinks in WordPress. Now, your permalinks will work again after rewriting the WordPress engine automatically. You need to refresh your browser, and then, visit one of your old posts to verify if your permalinks work again.

Resetting permalinks directly from htaccess file

If your server doesn’t allow to rewrite the rules automatically for security reasons, all you have to do is to add the below code in your htaccess file. That will rewrite the WordPress engine manually to reset all your WordPress permalinks. It will show you the same URL structure exactly as the one that you’ve previously selected from the dashboard.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

At the same time, you will get the latest permalinks that you’ve used before the error appears.
If you don’t have an idea on how to do that, login to cPanel, and locate your ”file manager” to open it.

Reset WordPress pemalinksYou will get all your blog root files, search for ”.htaccess” as the blow screenshot example.

Fixing 404 Not Found pages

Click on ”.htaccess”, then click “Edit File” at the top right of the page. Next, add the code at the bottom of the ”.htaccess” file, and click ”save changes”. If you only can access your site with FTP, then, read how to use Filezilla with WordPress.

Refresh your browser, and verify your blog permalinks. Usually, all your posts will work correctly, but, if you’re using a CDN service, you need to wait some minutes. It happens sometimes that your CDN will continue serving the old pages, and take some time to refresh the new link structure. Or, you can manually purge the cache from your account, or, from the caching plugin of you have one.

Still have broken permalinks?

If with all the above solutions, you sill have broken WordPress permalinks with 404 not found pages, then, be sure that you have a problem. In that case, you need to contact your hosting company and explain that you’ve tried all the permalinks rest solutions.

Many low quality hosting providers hosts site in poorly configured servers, and that’s why I always recommend to go premium and host your site with WP Engine. It’s the best managed and the fastest WordPress hosting provider, you will forget errors and problems. Best of all, the site super site speed and loading time will help ranking better in Google.

Fathi Arfaoui: A Physicist, Blogger, and the founder and owner of Trustiko.com. He shares Business, Blogging, WordPress, Web Safety, and Blogging tips to build better websites and blogs. Also, he shares online marketing strategies and recommendations.

Leave a Comment