WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is is possible to override the set # of blog posts to show per page (as defined under Reading Settings in the WordPress admin)? I want to make it so a custom loop that I am using will show an unlimited number.

share|improve this question
up vote 7 down vote accepted

The argument that controls how many posts are shown in the query is posts_per_page

<?php query_posts( array( 
                         'post_type' => 'post',
                         'posts_per_page' => -1 ) 

Also to note is that there is a bug in the 3.0 branch which prevents the -1 integer from displaying all posts. It is fixed in 3.1 but a workaround would be to use a very high number instead of -1



share|improve this answer
There's a typo in your parameter for posts_per_page. You have post_per_page instead of posts_per_page. (I tried to edit your post, but I don't have edit permissions). Many thanks! – user1462 Feb 7 '11 at 21:29
Good catch Thanks! I fixed it. – Chris_O Feb 7 '11 at 21:30

Sure, change the query by adding

<?php query_posts('post_type=post&numberposts=-1'); ?>

share|improve this answer

Eileen is right but it's better to use arguments as an array <?php query_posts( array( 'post_type' => 'post', 'numberposts' => -1 ) ); ?>

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.