This is How to Display 5 Instead of 20 Posts per Page on the WordPress Admin Dashboard
As a WordPress website owner or administrator, you may have noticed that the default number of posts displayed per page in the WordPress admin dashboard is set to 20. While this works well for many sites, there may be times when you want to adjust this setting to show fewer posts per page.
Perhaps you have a content-heavy website with hundreds or even thousands of blog posts, and navigating through the admin dashboard becomes cumbersome when so many posts are displayed at once. Or maybe you simply prefer a more compact and streamlined view of your content. Whatever your reasons, the good news is that it's easy to change the number of posts displayed per page in WordPress.
In this article, we'll walk you through the step-by-step process of adjusting the "Blog pages show at most" setting in the WordPress admin dashboard, as well as demonstrate how to modify your WordPress query to display a custom number of posts per page.
Adjusting the "Blog Pages Show at Most" Setting
The quickest and easiest way to change the number of posts displayed per page in the WordPress admin dashboard is to adjust the "Blog pages show at most" setting. Here's how:
- Log in to your WordPress admin dashboard.
- Navigate to the "Settings" section and click on "Reading".
- Under the "Blog pages show at most" setting, enter the number of posts you want to display per page. In this example, we'll use "5".
- Click the "Save Changes" button at the bottom of the page.
That's it! With just a few simple clicks, you've now set your WordPress admin dashboard to display 5 posts per page instead of the default 20.
Modifying the WordPress Query to Display 5 Posts per Page
While adjusting the "Blog pages show at most" setting is a quick and easy solution, it's important to note that this setting applies to the entire WordPress website, including the public-facing pages. If you only want to change the number of posts displayed on the admin dashboard and keep the public-facing pages at the default setting, you can modify the WordPress query directly.
Here's an example of how to do this:
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : '1';
$args = array (
'paged' => $paged,
'posts_per_page' => '5',
'post_type' => 'post',
);
// The Query
$query = new WP_Query( $args );
// The Loop
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();
// do stuff
}
} else {
// no posts found
}
// Restore original Post Data
wp_reset_postdata();
Let's break down the code:
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : '1';
: This line retrieves the current page number, which is necessary for pagination.
'posts_per_page' => '5',
: This sets the number of posts to display per page to 5.
'post_type' => 'post',
: This specifies that we only want to display posts (as opposed to other post types, such as pages or custom post types).
$query = new WP_Query( $args );
: This creates a new WP_Query object with the specified arguments.
if ( $query->have_posts() ) { ... }
: This checks if there are any posts to display and then proceeds to the loop.
while ( $query->have_posts() ) { ... }
: This is the main loop that displays the posts.
wp_reset_postdata();
: This restores the original post data after the loop is complete.
By modifying the 'posts_per_page'
argument in the $args
array, you can specify the number of posts to display per page in the admin dashboard. In this example, we've set it to 5, but you can adjust this value to suit your needs.
Real-World Examples and Statistics
To give you a better understanding of the impact that adjusting the number of posts displayed per page can have, let's look at some real-world examples and statistics.
According to a study by the Baymard Institute, users prefer to see between 10-20 products per page on e-commerce websites. However, this principle can also be applied to blog posts and content-heavy websites. Reducing the number of posts displayed per page can:
- Improve the user experience by making the admin dashboard more manageable and less cluttered.
- Reduce page load times, as fewer posts need to be loaded at once.
- Enhance the overall performance and responsiveness of the admin dashboard.
For example, let's say your WordPress website has 500 blog posts. With the default setting of 20 posts per page, the admin dashboard would display 25 pages of content. By reducing this to 5 posts per page, the number of pages is increased to 100, making it much easier to navigate and find specific content.
Additionally, according to a study by the web performance optimization firm Radware, a 1-second delay in page load time can result in a 7% reduction in conversions. By optimizing the number of posts displayed per page, you can help ensure that your admin dashboard loads quickly and efficiently, ultimately improving the overall user experience for your website's administrators and content creators.
Conclusion
In this article, we've demonstrated two methods for changing the number of posts displayed per page in the WordPress admin dashboard. By adjusting the "Blog pages show at most" setting or modifying the WordPress query directly, you can easily customize the number of posts shown to suit your preferences and the needs of your website.
Remember, optimizing the admin dashboard experience can have a significant impact on the productivity and efficiency of your website's management and content creation processes. By displaying the right amount of content per page, you can create a more streamlined and user-friendly admin interface that helps you and your team work more effectively.
If you're looking for a more comprehensive solution to optimize your website's performance and user experience, be sure to check out Flowpoint.ai. Flowpoint's AI-powered analytics and recommendation engine can help you identify technical, UX, and content-related issues that may be impacting your website's conversion rates, and provide tailored suggestions to address them
Get a Free AI Website Audit
Automatically identify UX and content issues affecting your conversion rates with Flowpoint's comprehensive AI-driven website audit.