;
Your Search Advisor logo

Wordpress next_posts_link() Broken?

Wednesday, May. 28th 2008 10:54 AM

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:

/page/*

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.


Posted by Andrew Miller | in YSA |

Leave a Reply

Contact Us | Privacy Policy | Careers
Copyright Your Search Advisor, LLC 2008
306 South Main Street, Suite LLA, Ann Arbor, MI 48104