How-to add pagination to WordPress posts

Posted on March 9, 2010 by Chris Duke
Share on Pinterest

Let’s say you have a really long post. I mean a really really long post. And you want to break it up somewhere in the middle. Or into three or four pages. How do you do it with WordPress?

It’s fairly simple, and uses some built-in WordPress functionality that is hidden.

1. Add the “NextPage Buttons” plugin to get the button into your editor (or something similar, there may be others). It looks very similar to the “Insert More tag” button, but instead of inserting <!–more–> it inserts <!–next–>

2. Edit your single.php (or whatever it happens to be with your theme) and add this code right after:

<?php the_content(); ?>

so it looks like this:

<?php the_content(); ?>
<?php wp_link_pages(); ?>

That’s it! Now add the <!–next–> tag as many times as you want in your post and you will start to see pagination below your post.

For more information on styling the wp_link_pages() just visit this page.

You can test it out here: