How To Fix Permalinks In Wordpress When All Else Fails
If you're new here, you may want to subscribe to my RSS feed.
Follow me on Twitter for Blog updates, my new software releases, and other announcements.
Thanks for visiting!
UPDATE:Please see Part II, which includes links to the official Wordpress support forum.
After trying everything from disabling plugins, to re-creating permalinks, to removing my .htaccess file, I still could not restore my permalink custom structure after upgrading Wordpress from version 2.5.1 to 2.6. I then posted a new topic in the forums for help and continued to search for answers.
Finally, using several posts and a hack of my own at the end, I came up with the following procedure which fixed it for me:
1. Upload this file to your wp-includes directory:
Save this link as “rewrite.php” and then upload it to your /wp-includes directory.
2. From the dashboard, set permalinks to “Default” and Save it.
3. From the dashboard, set permalinks to “Custom Structure” of your choice and Save it.
Mine is: /index.php/%year%/%monthnum%/%day%/%postname%/
4. The above fixed it, but I saw some errors at the top of each of my pages pointing to /wp-includes/plugin.php - so I added the following line of code which is a hack to suppress the errors:
error_reporting(0); Put this line at the top, just below the opening <?php tag.
That’s it. Please let me know if you have any problems by leaving a comment below.
Tags: 2.6, Wordpress, fix, hack, permalinks




















July 15th, 2008 at 11:12:45 AM
Kev,
Unfortunately the first 3 steps do not work on my website. Have you got any suggestions of further steps I could take to try and make it work.
Thanks.
July 15th, 2008 at 11:59:27 AM
Rob, what is it about “the first 3 steps” that you can not do? What happens?
July 15th, 2008 at 08:25:03 PM
Thanks alot!
I wasn’t happy at all when I found out that my permalinks where broken. They need WP 2.6.1 soon, haha.
-Dan
July 15th, 2008 at 08:29:34 PM
Dan: you’re welcome. I agree with the 2.6.1 idea…
July 16th, 2008 at 07:48:29 PM
Funny thing is, I am on apache on a *nix box… and 2.5 I had to use index.php/%postname%/ or it would not work.. now i can’t use it or anything to get permalinks to work. Only the default works. Even using the default theme, no plugins.
Same box, different site - default and with a theme, no plugins it works fine. /%category%/%postname%/
I even copied the .htaccess over - rules, permissions, owner, everything exact same. I cant figure it out
my .htaccess
‘
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
‘
AA Rewrite Rules reports
> Permalink: /%category%/%postname%/
> Writable .htaccess file found
> mod_rewrite found
> Not using pathinfo style index permalinks
> Using mod_rewrite permalinks
July 17th, 2008 at 10:35:29 AM
[...] How to Fix Permalinks in Wordpress When All Else Fails [...]
July 17th, 2008 at 11:42:10 PM
I followed your instructions for my client’s blog and it worked! Thank you very much. I’ll make sure to blog about your post so other people will know about it.
July 20th, 2008 at 05:12:34 PM
Your fix work, but not exactly as you explained.
I uploaded the rewrite.php file to my wp-includes folder, and then reset my custom permalinks structure. It worked fine, except for the two error lines above, which I didn’t like.
So I simply uploaded the original Wordpress 2.6 rewrite.php file, and lo and behold, the two error messages were gone, and the custom permalinks structure still works.
Very strange!
July 20th, 2008 at 05:28:24 PM
Ok, while my custom permalinks work fine now, it appears my category links and Tag plugin don’t. Fortunately archives still works, so I guess I will have to deal with that until v2.6.1
July 20th, 2008 at 07:29:10 PM
Here we go, in case you haven’t fixed your problem. The solution is here.
http://wordpress.org/support/topic/189058?replies=1
Simply remove the index.php from your permalink structure. When you do that, everything works fine. If linking from search engines that include “index.php” work fine.
At least for me they do.
July 22nd, 2008 at 09:47:50 PM
[...] you’re new here, you may want to subscribe to my RSS feed.Thanks for visiting!Thanks to Marc’s comment on my last post, fixing Permalinks is easier that I originally thought for Wordpress 2.6. Marc cites this post on [...]
July 24th, 2008 at 09:19:42 PM
[...] it didn’t work for me. Good thing I found this article “How to Fix Permalinks in Wordpress When All Else Fails”. The process involves [...]