{"id":33705,"date":"2018-01-08T14:13:00","date_gmt":"2018-01-08T20:13:00","guid":{"rendered":"https:\/\/wpengine.com\/?post_type=resource&#038;p=33705"},"modified":"2023-09-13T14:46:46","modified_gmt":"2023-09-13T19:46:46","slug":"wordpress-pagination","status":"publish","type":"resource","link":"https:\/\/wpengine.com\/case-studies\/resources\/wordpress-pagination\/","title":{"rendered":"WordPress Pagination"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-33723\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/pagination1.jpg\" alt=\"Adding pagination to wordpress\" width=\"1100\" height=\"400\" srcset=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2017\/12\/pagination1.jpg 1100w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2017\/12\/pagination1-300x109.jpg 300w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2017\/12\/pagination1-768x279.jpg 768w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2017\/12\/pagination1-1024x372.jpg 1024w\" sizes=\"auto, (max-width: 1100px) 100vw, 1100px\" \/><\/p>\n<p>The default previous\/next navigation feature for WordPress posts and pages works well in some cases. However, it isn\u2019t the most intuitive method. This is especially true for websites with a lot of published content.<\/p>\n<p>Pagination \u2013 a function that splits content into separate pages \u2013 is one option that enables you to refine your website\u2019s design and improve the way visitors navigate your content. This technique has both practical and aesthetic appeal, and it has become increasingly popular across the web.<\/p>\n<p>In this post, we\u2019ll introduce pagination and discuss various ways to add it to WordPress. This can be done using plugins, <a href=\"https:\/\/codex.wordpress.org\/AJAX#What_is_Ajax.3F\">Ajax<\/a>, or custom settings. Let\u2019s get started!<\/p>\n<h2>Adding Pagination to WordPress<\/h2>\n<p>If you want to add pagination to your WordPress website, you\u2019ll come across two major methods. The first is to use a plugin, and the second is through Ajax. We\u2019ll explain both of these approaches in-depth soon, and introduce a few custom tweaks you can make as well. Before that, let\u2019s consider the primary way pagination can be used in WordPress.<\/p>\n<h2>Blog Pagination in WordPress<\/h2>\n<p>Pagination is most commonly used in the blog sections of WordPress websites. It can be applied to individual posts, or used as a way to consolidate blog category pages:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-33724\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/pagination2.jpg\" alt=\"blog pagination in wordpress\" width=\"630\" height=\"179\" srcset=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2017\/12\/pagination2.jpg 630w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2017\/12\/pagination2-300x85.jpg 300w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><\/p>\n<p>Blog pagination offers numerous benefits, both to your website and its visitors. For example, pagination can increase your search engine rankings. This is because there will be an increased number of links (i.e. more pages) pointing to your website.<\/p>\n<p>For your visitors, pagination makes navigation simpler. Instead of using the default previous\/next navigation method for posts and pages, pagination enables readers to click on specific page numbers. This means they\u2019ll spend less time searching for posts and pages, and more time interacting with your content.<\/p>\n<h2>Pagination Plugins<\/h2>\n<p>The easiest way to use pagination in WordPress is with pagination plugins. A number of options exist, but let\u2019s look closely at some of the top solutions.<\/p>\n<p>First up is <a href=\"https:\/\/wordpress.org\/plugins\/wp-paginate\/\">WP-Paginate<\/a>. This plugin enables you to add numbered buttons just about anywhere on your site, including the <em>Blog Page<\/em>, <em>Search Page<\/em>, and <em>Home Page<\/em>. This helps improve your users\u2019 experience (by enabling them to skip ahead to the desired page), and enhances the appearance of your website:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-33725\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/pagination3.jpg\" alt=\"wordpress pagination plugin\" width=\"630\" height=\"200\" srcset=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2017\/12\/pagination3.jpg 630w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2017\/12\/pagination3-300x95.jpg 300w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><\/p>\n<p>Additionally, WP-Paginate enables you to customize the page buttons and even specific values (such as <em>Page Range<\/em> and <em>Page Gap<\/em>). This means you have control over the major elements of pagination.<\/p>\n<p>Second, let\u2019s take a quick look at <a href=\"https:\/\/wordpress.org\/plugins\/wp-pagenavi\/\">WP-PageNavi<\/a>. Similar to WP-Paginate, this plugin lets you add page numbers just about anywhere on your WordPress site. Unlike the previous plugin, however, it does require a bit of configuration:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-33726\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/pagination4.jpg\" alt=\"wordpress plugin for pagination\" width=\"630\" height=\"134\" srcset=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2017\/12\/pagination4.jpg 630w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2017\/12\/pagination4-300x64.jpg 300w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><\/p>\n<p>Both WordPress pagination plugins enable you to switch from the default previous\/next navigation to a more advanced, numbered system. They also let you add your own custom CSS if you\u2019d like. However, there is another way to achieve the same end.<\/p>\n<h2>Ajax Pagination in WordPress<\/h2>\n<p><a href=\"https:\/\/codex.wordpress.org\/AJAX#What_is_Ajax.3F\">Asynchronous JavaScript And XML (AJAX)<\/a> is a set of programming techniques that enables developers to create asynchronous web applications. In short, Ajax sends and retrieves information from a server without interfering with the page\u2019s appearance, because it runs in the background. Ajax is used to change dynamic page content without reloading the entire page. This is commonly seen with infinite scroll, but also applies to pagination.<\/p>\n<p>Using Ajax pagination, a website can frequently update with new content (such as blog posts) without interrupting the user\u2019s experience. Your readers can see all the latest content you post while they\u2019re on the page, but it won\u2019t reload each time. Additionally, when users click onto the next page, they don\u2019t have to wait for it to completely reload.<\/p>\n<h3>Ajax Pagination Without Plugins<\/h3>\n<p>We introduced a few plugin options above that enable you to add pagination to your WordPress website. However, Ajax pagination can be done without using a plugin.<\/p>\n<p>It\u2019s important to understand that this process requires quite a bit of coding. This means you should seriously consider <a href=\"https:\/\/wpengine.com\/resources\/create-child-theme-wordpress\/\" target=\"_blank\" rel=\"noopener noreferrer\">creating a child theme<\/a> first. That way, you\u2019ll be able to make changes to your current website theme without interfering with its default code. This reduces the chance that you\u2019ll make any critical mistakes, and makes it very easy to add your own code to the theme files.<\/p>\n<p>Once your child theme is set up, there are <a href=\"https:\/\/premium.wpmudev.org\/blog\/load-posts-ajax\/\">three main steps<\/a> to adding pagination to your site. Here is an overview of the process:<\/p>\n<ol>\n<li><strong>Create an event.<\/strong> This is where you decide which action on your website (such as clicking a page number) will trigger the JavaScript part of the process.<\/li>\n<li><strong>Create an Ajax call.<\/strong> Once JavaScript is \u2018activated\u2019, a request for data will be sent to the web server.<\/li>\n<li><strong>Communicate with WordPress.<\/strong> Finally, the server\u2019s response will determine how WordPress functions. In this case, it will call up a new page of content without reloading the entire page.<\/li>\n<\/ol>\n<p>It\u2019s easy to see how Ajax can improve pagination. All of these steps take place in a matter of seconds, which improves your site\u2019s user experience immensely.<\/p>\n<h2>Custom Pagination<\/h2>\n<p>If you\u2019d rather not use Ajax, you may be wondering if there are other ways to build custom pagination for your WordPress website. While plugins offer a few useful features, you can also alter your site\u2019s pagination functionality yourself.<\/p>\n<p>For example, you can modify the number of posts that will appear per page. While WordPress sets the default to 10, you can change that to almost any number you\u2019d like. To do so, go to <em>Settings<\/em> &gt; <em>Reading<\/em> &gt; <em>Blog pages show at most<\/em>. Here, you can increase or decrease the value directly:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-33727\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/pagination5.jpg\" alt=\"custom wordpress pagination\" width=\"630\" height=\"335\" srcset=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2017\/12\/pagination5.jpg 630w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2017\/12\/pagination5-300x160.jpg 300w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><\/p>\n<p>Another custom pagination feature that many users aren\u2019t aware of is the ability to <a href=\"https:\/\/firstsiteguide.com\/split-article-multiple-pages\/\">split a single post<\/a> into multiple pages. This is great for list articles, or other types of long-form content. To implement this feature, all you need to do is add &lt;!\u2013<em>nextpage<\/em>\u2013&gt; (while in <em>Text Editor<\/em>) between the content you\u2019d like to split:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-33728\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/pagination6.jpg\" alt=\"wordpress blog pagination\" width=\"630\" height=\"240\" srcset=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2017\/12\/pagination6.jpg 630w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2017\/12\/pagination6-300x114.jpg 300w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><\/p>\n<p>If you\u2019re a more advanced user, you can also experiment with CSS (within the <em>styles.css<\/em> file) to further customize your pagination. You can change elements such as backgrounds and font colors, padding elements, and hover effects. With a little work, you can set up your site\u2019s pagination however you\u2019d like!<\/p>\n<p>Would you like to learn about more interesting elements you can add to your website? Follow <a href=\"https:\/\/wpengine.com\/\">WP Engine<\/a>, and you\u2019ll find plenty of articles on WordPress news and up-and-coming features. To get even more from WP Engine, you can also check out <a href=\"https:\/\/wpengine.com\/plans\/\">our managed hosting plans<\/a>, which provides dedicated support and practically everything you need to run an effective website!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The default previous\/next navigation feature for WordPress posts and pages works well in some cases. However, it isn\u2019t the most intuitive method. This is especially true for websites with a lot of published content. Pagination \u2013 a function that splits content into separate pages \u2013 is one option that enables you to refine your website\u2019s<span class=\"tile__ellipses\">&hellip;<\/span><span class=\"tile__ellipses--animated\"><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"template":"","resource-topic":[912],"resource-role":[906,897,899],"resource-type":[916],"class_list":["post-33705","resource","type-resource","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Adding Pagination to WordPress | WP Engine\u00ae<\/title>\n<meta name=\"description\" content=\"Discover your options for page pagination in WordPress. In this post we will cover popular plugins, as well as custom options for pagination.\" \/>\n<meta name=\"robots\" content=\"noindex, follow\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Adding Pagination to WordPress | WP Engine\u00ae\" \/>\n<meta property=\"og:description\" content=\"Discover your options for page pagination in WordPress. In this post we will cover popular plugins, as well as custom options for pagination.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wpengine.com\/case-studies\/resources\/wordpress-pagination\/\" \/>\n<meta property=\"og:site_name\" content=\"WP Engine\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/wpengine\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-13T19:46:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/pagination1.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@wpengine\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/wordpress-pagination\/\",\"url\":\"https:\/\/wpengine.com\/case-studies\/resources\/wordpress-pagination\/\",\"name\":\"Adding Pagination to WordPress | WP Engine\u00ae\",\"isPartOf\":{\"@id\":\"https:\/\/wpengine.com\/case-studies\/#website\"},\"datePublished\":\"2018-01-08T20:13:00+00:00\",\"dateModified\":\"2023-09-13T19:46:46+00:00\",\"description\":\"Discover your options for page pagination in WordPress. In this post we will cover popular plugins, as well as custom options for pagination.\",\"breadcrumb\":{\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/wordpress-pagination\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wpengine.com\/case-studies\/resources\/wordpress-pagination\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/resources\/wordpress-pagination\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/wpengine.com\/case-studies\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Resources\",\"item\":\"https:\/\/wpengine.com\/case-studies\/resources\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"WordPress Pagination\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#website\",\"url\":\"https:\/\/wpengine.com\/case-studies\/\",\"name\":\"WP Engine\",\"description\":\"Managed Hosting for WordPress\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wpengine.com\/case-studies\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/f5301455463371a10d1fc290e9ad0085\",\"name\":\"WP Engine\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d8770fe9625ca7c4601f13d9d0ab86565a6dac8cd6a77bfe2ada6d83c6837870?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d8770fe9625ca7c4601f13d9d0ab86565a6dac8cd6a77bfe2ada6d83c6837870?s=96&d=mm&r=g\",\"caption\":\"WP Engine\"},\"sameAs\":[\"https:\/\/wpengine.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Adding Pagination to WordPress | WP Engine\u00ae","description":"Discover your options for page pagination in WordPress. In this post we will cover popular plugins, as well as custom options for pagination.","robots":{"index":"noindex","follow":"follow"},"og_locale":"en_US","og_type":"article","og_title":"Adding Pagination to WordPress | WP Engine\u00ae","og_description":"Discover your options for page pagination in WordPress. In this post we will cover popular plugins, as well as custom options for pagination.","og_url":"https:\/\/wpengine.com\/case-studies\/resources\/wordpress-pagination\/","og_site_name":"WP Engine","article_publisher":"https:\/\/www.facebook.com\/wpengine","article_modified_time":"2023-09-13T19:46:46+00:00","og_image":[{"url":"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/pagination1.jpg"}],"twitter_card":"summary_large_image","twitter_site":"@wpengine","twitter_misc":{"Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/wpengine.com\/case-studies\/resources\/wordpress-pagination\/","url":"https:\/\/wpengine.com\/case-studies\/resources\/wordpress-pagination\/","name":"Adding Pagination to WordPress | WP Engine\u00ae","isPartOf":{"@id":"https:\/\/wpengine.com\/case-studies\/#website"},"datePublished":"2018-01-08T20:13:00+00:00","dateModified":"2023-09-13T19:46:46+00:00","description":"Discover your options for page pagination in WordPress. In this post we will cover popular plugins, as well as custom options for pagination.","breadcrumb":{"@id":"https:\/\/wpengine.com\/case-studies\/resources\/wordpress-pagination\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wpengine.com\/case-studies\/resources\/wordpress-pagination\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/wpengine.com\/case-studies\/resources\/wordpress-pagination\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wpengine.com\/case-studies\/"},{"@type":"ListItem","position":2,"name":"Resources","item":"https:\/\/wpengine.com\/case-studies\/resources\/"},{"@type":"ListItem","position":3,"name":"WordPress Pagination"}]},{"@type":"WebSite","@id":"https:\/\/wpengine.com\/case-studies\/#website","url":"https:\/\/wpengine.com\/case-studies\/","name":"WP Engine","description":"Managed Hosting for WordPress","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wpengine.com\/case-studies\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/f5301455463371a10d1fc290e9ad0085","name":"WP Engine","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d8770fe9625ca7c4601f13d9d0ab86565a6dac8cd6a77bfe2ada6d83c6837870?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d8770fe9625ca7c4601f13d9d0ab86565a6dac8cd6a77bfe2ada6d83c6837870?s=96&d=mm&r=g","caption":"WP Engine"},"sameAs":["https:\/\/wpengine.com"]}]}},"acf":[],"grid_image_url":"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2017\/12\/Untitled-design-2.jpg","media-type":{"term_id":916,"name":"Article","slug":"article"},"role":"<strong>Roles:<\/strong> Entrepreneur, Freelancer, Site Owner","topic":"<strong>Topics:<\/strong> Performance","_links":{"self":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource\/33705","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource"}],"about":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/types\/resource"}],"author":[{"embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/users\/1"}],"wp:attachment":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/media?parent=33705"}],"wp:term":[{"taxonomy":"resource-topic","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-topic?post=33705"},{"taxonomy":"resource-role","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-role?post=33705"},{"taxonomy":"resource-type","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/resource-type?post=33705"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}