The Ultimate Guide to Customizing Your WordPress Posts Per Page (2023)

Hey there, WordPress user! Are you looking to take control of how many posts are displayed on your blog, category, and tag archive pages? You‘ve come to the right place.

As a WordPress expert, I‘m here to walk you through everything you need to know about customizing your posts per page settings to create the optimal reading experience for your visitors and boost your site‘s performance in the process.

First, let‘s talk about why this matters. Your archive pages are often a reader‘s first introduction to your content. A well-designed archive can keep visitors engaged, clicking through to more pages, and coming back for more.

On the flip side, a cluttered, slow-loading archive can drive readers away before they even get started. In fact, a mere 1 second delay in page load time can result in a 7% reduction in conversions (source).

Customizing how many posts appear on each archive page is a key part of finding that sweet spot between content discovery and speedy performance. Let‘s dive into how it works.

How to Change the Posts Per Page in WordPress

By default, WordPress displays your 10 most recent posts on the main blog index page (/blog) as well as archive pages for categories, tags, authors, dates, and more. So the URL yoursite.com/category/uncategorized would show the latest 10 posts in the "Uncategorized" category.

Luckily, WordPress makes it easy to change this setting to any number you want. Here‘s how:

  1. Log in to your WordPress dashboard and navigate to Settings > Reading.
  2. Look for the "Blog pages show at most" option.
  3. Enter the number of posts you want to display per page.
  4. Click "Save Changes" and you‘re all set!

WordPress posts per page setting

Now, let‘s say you changed the setting to 5 posts per page. When a visitor goes to yoursite.com/blog or yoursite.com/category/example, they would see the 5 most recent posts in that archive.

To see older posts, they would click the pagination links, which typically look something like:

« Previous   1   2   3   …   12   Next »

Clicking "Next" or the page number would take them to URLs like:

yoursite.com/blog/page/2
yoursite.com/category/example/page/3

Each of these paginated archive pages would display the next set of 5 posts in the archive. This continues until all posts in the archive have been displayed.

SEO-Friendly Pagination

It‘s important to note that the posts per page setting directly impacts the number of paginated archive pages WordPress generates, which can affect your site‘s SEO.

Let‘s say you have 50 posts in the "Example" category. With 5 posts per page, WordPress would generate 10 paginated archive pages at URLs like:

/category/example
/category/example/page/2
/category/example/page/3
...
/category/example/page/10

Compare that to showing 25 posts per page, which would only generate 2 paginated archive pages:

/category/example 
/category/example/page/2

In general, you want to find a balance that limits the number of paginated archive pages while still providing a good user experience. More on that later.

It‘s also a good idea to customize the rel="next" and rel="prev" pagination links to help search engines understand the relationship between the paginated archive pages. Something like this:

<link rel="next" href="https://yoursite.com/category/example/page/2" />

You can use a plugin like WP-Pagination to automatically add these pagination links to your archive pages.

Choosing the Optimal Posts Per Page

Now that you know how to change the posts per page setting, the natural next question is: what‘s the "right" number to choose?

The answer is… it depends. As a general rule, I recommend starting with 10 posts per page and adjusting up or down based on your content, audience, and goals.

Here are a few factors to consider:

  • Post length: If you tend to write longer, in-depth content (1000+ words), you may want to display fewer posts per page to keep load times in check. If you publish shorter, punchier posts, you can likely get away with more.

  • Media usage: Posts with a lot of images, embeds, or other media will take longer to load than plain text posts. Keep this in mind when deciding how many to show at once.

  • Audience preferences: Think about how your particular audience likes to consume content. Do they prefer to scroll and browse, or do they want to quickly find what they‘re looking for? You may need to experiment and see what generates the most engagement.

  • Advertising strategy: If you rely on ad revenue, showing more posts per page can increase ad impressions. But be careful not to overdo it and compromise user experience.

  • Server resources: The more posts you display, the more work your server has to do to generate the page. If you‘re on a shared hosting plan or have limited resources, you may need to be more conservative with your posts per page.

As a starting point, here‘s how many posts some popular WordPress sites display on their main blog index page:

SitePosts Per Page
Smashing Magazine10
Kinsta12
WPBeginner14
Yoast10
WP Mayor10

Of course, these sites likely have robust hosting and performance optimization in place. Your mileage may vary.

To find the right number for your site, I recommend starting with 10 posts per page and monitoring your site‘s speed and engagement metrics (such as time on page, bounce rate, and pages per session). Tools like PageSpeed Insights and GTmetrix can help you gauge your page load times.

If you‘re in the green, try bumping it up to 12 or 15 and see how it affects your metrics. If you‘re seeing long load times or high bounce rates, try scaling back to 8 or 5. The key is to find the balance that keeps both your readers and your site performance happy.

Customizing Posts Per Page for Different Archives

By default, the posts per page setting applies to all of your archive pages – categories, tags, authors, dates, search results, etc. But what if you want to show a different number of posts for certain archive types?

For example, maybe you want to show 10 posts per page on your main blog index, but only 5 posts per page for your category archives. Or perhaps you want to show more posts for a specific category that you‘re trying to promote.

You can absolutely customize the posts per page setting for different archive types using a bit of code. Here‘s how:

Changing Posts Per Page for Specific Archives

To change the number of posts for a specific archive type (e.g. category, tag, author), you can use the pre_get_posts hook to modify the main query.

For example, to show 5 posts per page for the "Example" category archive, you would add this code to your theme‘s functions.php file or a site-specific plugin:

function custom_posts_per_category( $query ) {
    if ( $query->is_main_query() && $query->is_category( ‘example‘ ) ) {
        $query->set( ‘posts_per_page‘, 5 );
    }
}
add_action( ‘pre_get_posts‘, ‘custom_posts_per_category‘ );

You can modify this code to target other archive types by changing the conditional tag in the if statement. Here are some common ones:

  • is_tag() – Tag archives
  • is_author() – Author archives
  • is_date() – Date archives
  • is_search() – Search results

You can also target a specific category, tag, or author by passing the term ID, slug, or name to the respective conditional tag. For example:

if ( $query->is_category( ‘example-category‘ ) ) {
    // Show 5 posts per page for the "example-category" category archive
    $query->set( ‘posts_per_page‘, 5 );
}

Changing Posts Per Page for Custom Post Types

If you‘re using custom post types on your site, you can also customize the posts per page setting for those archive pages.

For example, let‘s say you have a "Products" custom post type and you want to display 20 products per page in the archive. Here‘s how you would modify the pre_get_posts hook:

function custom_posts_per_product_archive( $query ) {
    if ( $query->is_main_query() && $query->is_post_type_archive( ‘product‘ ) ) {
        $query->set( ‘posts_per_page‘, 20 );
    }
}
add_action( ‘pre_get_posts‘, ‘custom_posts_per_product_archive‘ );

This code checks if we‘re on the main query for the "product" post type archive and, if so, sets the posts per page to 20.

You can use a similar approach to target specific product categories or tags by using the is_tax() conditional tag. For example:

if ( $query->is_tax( ‘product_category‘, ‘example-category‘ ) ) {
    // Show 20 posts per page for the "example-category" product category archive
    $query->set( ‘posts_per_page‘, 20 );
}

Optimizing Your Archive Pages for Search Engines

In addition to customizing your posts per page, there are a few other things you can do to optimize your archive pages for search engines:

  1. Use descriptive titles and headings: Make sure your archive pages have clear, keyword-rich titles and headings that describe the content of the archive. For example, "10 Tips for Growing Tomatoes" is better than just "Category: Gardening".

  2. Customize your meta descriptions: Write unique, compelling meta descriptions for each archive page that entice searchers to click through from the search results. You can use a plugin like Yoast SEO to customize your archive meta descriptions.

  3. Add schema markup: Use Schema.org markup to help search engines better understand the structure and content of your archive pages. For example, you can use the ItemList schema type to mark up your archive as a list of posts.

  4. Optimize your pagination: Make sure your paginated archive pages use SEO-friendly URLs and add rel="next" and rel="prev" pagination links as described above. You should also make sure the paginated pages are accessible to search engine crawlers.

  5. Link to your archives: Add links to your archive pages from other relevant pages on your site, such as your homepage, navigation menu, or related posts. This helps search engines discover and crawl your archive pages while also providing additional context.

By following these tips and customizing your posts per page setting, you can create archive pages that are both user-friendly and search engine-friendly.

Conclusion

Whew, that was a lot of information! Let‘s recap the key points:

  • Customizing the number of posts per page on your WordPress site can improve user experience, site performance, and SEO.
  • You can change the posts per page setting under Settings > Reading in your WordPress dashboard.
  • The "right" number of posts to show depends on your content, audience, and goals, but 10-15 is a good starting point for most sites.
  • You can use the pre_get_posts hook to customize the posts per page setting for specific archive types, such as categories, tags, or custom post types.
  • In addition to customizing your posts per page, you can optimize your archive pages for search engines by using descriptive titles, meta descriptions, schema markup, SEO-friendly pagination, and internal linking.

The most important thing is to experiment and find what works best for your unique site and audience. Don‘t be afraid to try different settings and see how they affect your traffic and engagement.

And if you need more control over the appearance and layout of your archive pages, you can always use a plugin like Archive Page Template or Archive Customizer to create custom archive page designs without coding.

I hope this in-depth guide has given you the knowledge and tools you need to optimize your WordPress archive pages and create a better experience for your readers. If you have any questions or tips of your own, feel free to leave a comment below!

Did you like this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.