Those who have been working with WordPress for some time know, that there is an issue with WP pagination on category pages. If you use any of the built-in permalink settings, pagination works fine. The problem starts when you set your posts permalinks to “custom”.
When choosing a custom permalinks (e.g. at magstags.com I set up my permalinks to: /%category%/%postname%/), it breaks pagination and the links generate 404 pages/ 404 error (“page not found”).
Why does the category pagination break?
After setting up your permalink structure to /%category%/%postname%/, second page URL of category listing page will be /category-name/page/2/ . WordPress firstly check if the next component after “category’ is subcategory and if it is not, then it will assume it must be a post name, so it will treat the “page” element as a post name. However in reality the “page” isn’t really a part of the structure as such a post doesn’t exist. As a result, 404 page will be returned.
It is a bit shame that such a silly problem still exist in 4.1 version of WordPress!
WordPress Category Pagination Fix
A few years back, I have tested quite a few solutions including some .php functions, but nothing really worked. After hours and hours of work on the category page (template category.php) I came across this plugin: “Category pagination fix”. I installed and activated and all is working nicely.
Although this plugin hasn’t been updated for some time, I have never came across any issue correlated with its installation. At the moment, I use the latest version of WordPress (4.1) and one of the latest responsive themes and I have no issues with it. I have also recently looked for a new solution, but I haven’t found anything better than this old “Category pagination fix” plugin.
SEO implications and Set up
Now if you use paginated pages, there are some SEO implications connected to it usage. Since your website is set up in WordPress, paginated category pages will add page numbers to URLs, e.g. /category-name/page/2/, /category-name/page/3/ etc. If not set up correctly, Google might flag it as a duplication and thin content. For larger websites, it is also connected with a management of crawl efficiency (because of crawl limitations).
Also, if your homepage is not set up to a “static page” (in dashboard > setting> reading), the homepage will show latest posts and you will have a similar issue as your homepage content is spread over the span of multiple pages.
To sort this, Google introduced a few solutions. The most relevant solution is to add rel=”next” and rel=”prev” tags to paginated pages, so that they can distinguish them as a series and send users to the most relevant page/URL—typically the first page of the series.
The tags need to be added in the <head> section of the website. By implementing rel=”prev”/”next”, you create a chain between all pages in the pagination series. It is also recommended to add canonical tag to the page itself.
On the homepage, http://magstags.com :
<link rel=’next’ href=’http://magstags.com/page/2/’ />
<link rel=”canonical” href=”http://magstags.com/” />
on the 2nd page, http://magstags.com/page/2/:
<link rel=’prev’ href=’http://magstags.com/’ />
<link rel=’next’ href=’http://magstags.com/page/3/’ />
<link rel=”canonical” href=”http://magstags.com/page/2/” />
The great news is that you do not need to reach out to developers to implement it. There are already many great plugins out there like All in One SEO plugin or WordPress SEO, which after installation and activation automatically add those tags to your paginated pages.
Hope that helps!