I finally got around to diagnosing and fixing the “Previous Entries” and “Next Entries” broken links on my blog’s WordPress 2.5 platform. Since the very first post on this blog, the next_posts_link() and previous_posts_link() functions were not working as advertised and I didn’t know why. It has been on my list of bugs to fix for quite some time, so I finally devoted a little time this morning to silence the little nagging to-do item.
If you have an SEO-friendly WordPress blog you might have changed the permalink structure to create more human-readable URLs for each post. For example, the default WordPress post permalink is www.yourblog.com/?p=123, where 123 is the unique ID for that particular post. There are many plugins that allow you to create keyword-rich URLs that rewrite the p=123 into something like www.yourblog.com/your-sample-post/. Rewriting the permalinks for your blog posts could inadvertently disrupt other static URLs in your WordPress platform, such as the www.yourblog.com/page/2/ and www.yourblog.com/page/3/ pages that are accessed via the “Previous Entries” and “Next Entries” links. These pages hold your older posts that have been bumped off of the first page of your blog.
It’s a simple fix for a common problem. Within the Settings of your WordPress dashboard, click on the Permalink Redirect tab. Within the Permanent Redirect Manager, include the following line in the “Paths to be skipped” box:
This tells your site not to try to rewrite any URLs in the /page/ directory. The * is a “wildcard” that basically means “anything”. You can substitute other directory paths in there that you don’t manage with the permalink redirect plugin that you may be using.
Hope this is helpful, and that it helps you check one more thing off of your to-do list.