Split long posts into multiple pages in WordPress

Filed as Features, Guides on June 14, 2007 6:56 am

Repost This

Have you ever read an online article that was so long that it was split into several pages so you didn’t have to load one long page, and instead, you had several smaller pages, making it easier to digest? If you’re using WordPress as your blogging platform, this very same effect can be easily achieved!

This is a feature of WordPress that is not very well known, probably because blog posts are generally not meant to be as long as a New York Times article. Keep in mind that WordPress is not only used as a blogging platform, but it can also be used as a complete CMS for your website, so there may be times when you DO have articles that are long enough to require the use of pagination (pagination simply means “the numbering of the pages.”)

Other people may prefer to split up their one, long blog post into multiple posts instead. Whatever you choose to do, it’s entirely up to you; what I’m offering to you here is simply another option that you can use in the future.

In order to paginate your blog post, in the Write panel in your WordPress admin, switch to the Code view (if you are using the Visual view) and then enter the following code to wherever you want to break the post up into a new page. An example is also offered along with it:

...so John went to sleep.

<!--nextpage-->

The next day, he...

This will create a list of pages that make up that post, shown like this:

Page 1, 2, 3

And you’re all done!

Gary King is a professional freelance web developer, primarily using Ruby on Rails and PHP to create cool new websites. When he’s not trying to take over the world one blog at a time, you can find him mulling over his thoughts at King Gary.

Tags:

This post was written by

You can visit the for a short bio, more posts, and other information about the author.

Submissions & Subscriptions

Submit the post to Reddit, StumbleUpon, Digg or Del.icio.us.

Did you like it? Then subscribe to our RSS feed!



  1. By franky posted on June 14, 2007 at 7:08 am
    Want an avatar? Get a gravatar! • You can link to this comment

    Gary, Lorelle is going to kill you! :D

    Reply

  2. By charlie posted on June 14, 2007 at 7:45 am
    Want an avatar? Get a gravatar! • You can link to this comment

    Haha, franky, I was just thinking exactly the same thing! I was even thinking this might be a post by Lorelle about the issue of splitting posts into pages from the title in my feed reader.

    Reply

  3. By Everton posted on June 14, 2007 at 8:45 am
    Want an avatar? Get a gravatar! • You can link to this comment

    I’ve been doing this for a while now, but I’ve only recently realised that the additional pages aren’t displayed to feedreaders, and they don’t even know they are there – WP need to fix this

    Reply

  4. By pelf posted on June 14, 2007 at 10:13 am
    Want an avatar? Get a gravatar! • You can link to this comment

    *giggles* at franky’s comment, LOL.

    Reply

  5. By Nia posted on June 14, 2007 at 10:15 am
    Want an avatar? Get a gravatar! • You can link to this comment

    This is great. It means I can, keep all post content above the fold with this simple insertion…I’ll see what the results look like in the reader where I allow “full” feed.

    Presently I am monetizing my sidebars so in fact I may want people to read below the fold however this is a great tool.

    Thanks. I’ll use it and if I want people to read below the fold, for the monetization of the sidebar below the fold then I’ll just display two or three posts at a time on the front page. This is a very nice tool.

    I’m going to implement and post about int now. (now means 1-2 hours, if I”m not interrupted, of course)

    Reply

  6. By J. Angelo Racoma posted on June 14, 2007 at 10:22 am
    Want an avatar? Get a gravatar! • You can link to this comment

    OMG Gary! What have you just done?

    Reply

  7. By J. Angelo Racoma posted on June 14, 2007 at 10:25 am
    Want an avatar? Get a gravatar! • You can link to this comment

    Nia, I prefer to use excerpts instead on the front page (or you can use the MORE function). This way, users have a cleaner view of the front page, and I get more page views on individual articles.

    I’m not really into pagination, though, for reasons of usability, and because my blog posts are usually not that long. In those rare instances of lengthy posting, I use headers (enclosed with header tags like <h3></h3>).

    Good, simple, tutorial, though. I think pagination does have a use–and that’s for the really long articles.

    Reply

  8. By Nia posted on June 14, 2007 at 10:31 am
    Want an avatar? Get a gravatar! • You can link to this comment

    uh, oh…by inserting whre I wanted teh page break I ended up with a first page and no second page at all. Clearly I’m missing something (like a course on coding). So I’ll have to put this into my RSS Shareds until I have time to search for more guidance.

    I don’t think I have an subscribers so the fact that it’s not visible in a reader is a moot point actually. ;)

    Keeping my posts under 500 words is a goal but still I do have a few posts at several of my sites that are way way long.

    I’ll either go back and edit, split into separate posts or this technique you’ve introduced me to when I understand what was apparently not obvious to me the first go ’round.

    Thanks, all the best!

    Reply

  9. By Chris posted on June 14, 2007 at 11:06 am
    Want an avatar? Get a gravatar! • You can link to this comment

    Now, if more WP Theme designers were aware of this. Often times, they leave out the necessary Template Tags to make that actually work.

    WP Codex article: http://codex.wordpress.org/Styling_Page-Links

    Reply

  10. By Nia posted on June 14, 2007 at 3:48 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    Thank you Chris and J now I understand why the was simply loping off half of the post. My template, as it stands is a bit “handicapped” in the codex dept.

    I’ll look into using the “more” That feature would be a nice way to take people down the length of the page scanning the title, illustration and couple of paragraphs of 3 distinct posts in succession.

    Reply

  11. By Gary King posted on June 14, 2007 at 3:57 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    I never use this method myself, but there ARE times when you’re building a website using WordPress as a CMS and you want to use this functionality. It’s something that’s not commonly known, so I just wanted to throw it out there.

    Reply

  12. By J. Angelo Racoma posted on June 14, 2007 at 10:28 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    Online magazines often use page breaking to split long articles. I agree that sites using WP as a CMS would find this useful. But am I right to assume that the code for displaying/supporting pagination is not present in most downloadable themes these days (meaning the user has to add them to either index or single post file)?

    Reply

  13. By Gary King posted on June 14, 2007 at 11:13 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    I believe that pagination is built into the same function that outputs content, so as long as you can see post content, then pagination will work.

    Reply

  14. By Elixir Web Solutions posted on June 15, 2007 at 1:22 am
    Want an avatar? Get a gravatar! • You can link to this comment

    ya , u r right .. i have seen in many article comes in sections or part 1,2 3.. and so on …And it is easy to read full article ..

    Thanks,
    Elixir Web Solutions
    Web Design Services from India

    Reply

  15. Friday Fishwrap: June 15June 15, 2007 at 9:25 am
  16. By Chris posted on June 15, 2007 at 9:26 am
    Want an avatar? Get a gravatar! • You can link to this comment

    I believe that pagination is built into the same function that outputs content [...]

    Hi Gary – I’m afraid not. The link I left here yesterday, to the WP Codex, explains more.

    Reply

  17. By Joe Clark posted on June 15, 2007 at 11:45 am
    Want an avatar? Get a gravatar! • You can link to this comment

    While this may indeed be a WordPress feature, your advice is nuts and is, frankly, anti-Web.

    Reply

  18. By Gary King posted on June 15, 2007 at 1:09 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    Joe, for the XHTML zealot, using <b> instead of <strong> is also madness in most cases. Even though that may be the case, there ARE indeed certain situations where one may still want to use <b> because they want to FORCE something to be in bold text (since <strong> only OPTIONALLY makes something bold). I like to think that this equally gives the author the option of using this, without forcing them to do so.

    Reply

  19. Split Long Posts Into Multiple Pages In WordPress [Linkosphere]June 15, 2007 at 9:02 pm
  20. By Nia posted on June 15, 2007 at 9:06 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    Chris, the codex was very helpful. The “more” works for me just fine. Thanks for your help.

    Reply

  21. How to Split Long Posts Into Multiple Pages « Sabahan.comJune 18, 2007 at 6:00 am
  22. By Vito Raliffe posted on July 14, 2007 at 3:03 am
    Want an avatar? Get a gravatar! • You can link to this comment

    This article saved my life =D One of my articles were so long that the page starting breaking up, so I looked for how to use multiple pages in Google and this was the first thing that popped up! Thanks!

    Reply

  23. By AL posted on December 5, 2008 at 5:35 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    Hi Gary or anyone else… I’ve created a page which is really long (its a tutorial) and i find that if i use the nextpage tag it does not show the Page 1, Page 2 links at the bottom of the artice/page.

    Any help?

    Reply

  24. By BHanu posted on May 31, 2009 at 9:16 am
    Want an avatar? Get a gravatar! • You can link to this comment

    Hi, this will not work for every template. I have already done all these stuff even more, but no use.

    Reply

  25. By Damir - SEO Tips posted on June 16, 2009 at 7:37 am
    Want an avatar? Get a gravatar! • You can link to this comment

    To AL and BHanu:
    I have been exploring this as well and same thing happened to me, nothing showed on article/post. Then I found that my template (single.php) was missing some code at the WP codex (http://codex.wordpress.org/Styling_Page-Links) it states that your single.php has to have code in it in order to work. So I did placed that little code under ( …?php the_content(‘Read more »’);…) part and it worked. Hope that will help you.

    I’m now trying to get title tags to display different tags on each page as I’m trying to split cell phone review post into review and specs pages. I’m using SEO Title tags plugin. any help?

    Reply

  26. By Damir - SEO Tips posted on June 16, 2009 at 9:02 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    Sorry the code did not display: php wp_link_pages(); . Of course it goes in between tags.

    Reply

  27. By Giast posted on October 20, 2009 at 1:27 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    Grazie!! Thank you for this post, very helpful!!

    Reply

  28. By shopfordesigns posted on December 1, 2009 at 6:21 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    Even I use wordpress for my blog on shopfordesigns but I never knew this trick of breaking long messages into pages.

    I will look around and implement this on my blog even though i dont write very big articles.

    Excellent post!!! Thanks!!!

    Reply

  29. How To Split Long WordPress Pages and Posts | CoachNotesJanuary 19, 2010 at 1:08 am
  30. By Riyad posted on August 26, 2010 at 5:58 am
    Want an avatar? Get a gravatar! • You can link to this comment

    I realize this is an older post, but at the beginning of my day-raping journey down the path of “how to add multi-page post support to WordPress” I started with posts like this one and the WP codex to figure out what and
    wp_link_pages did to then find myself spending just as much time hunting down CSS that made page links that didn’t look like garbage.

    I wrote up a tutorial covering my whole process with code snippets to get you from nothing to multi-page story support in about 5-10 mins here:
    http://www.thebuzzmedia.com/how-to-add-page-link-tag-multiple-page-post-nextpage-support-to-wordpress/

    There is starter CSS there too, to get you clean/simple page buttons atleast out of the box, obviously edit to taste.

    Reply

  31. By majalah posted on September 16, 2010 at 2:26 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    I thought split long post need a wp plugin. But, it only use ‘built in’ wp code.

    Reply

  32. By Steve posted on September 20, 2010 at 10:42 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    This worked great for me. Thanks!

    Reply

  33. By Keith Varias posted on October 3, 2010 at 5:26 am
    Want an avatar? Get a gravatar! • You can link to this comment

    Thanks a lot. This is really helpful.

    Reply

  34. By Kristian posted on October 4, 2010 at 4:37 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    Can I display the pages in the form of dropdown menu? Thanks

    Reply

  35. By intensiveseo.com posted on December 7, 2010 at 10:27 am
    Want an avatar? Get a gravatar! • You can link to this comment

    I was doing multiple posts for each parts of my article but this trick will save me a lot of time. Thanks for the share!

    Reply

  36. By Ansh posted on June 12, 2013 at 5:39 am
    Want an avatar? Get a gravatar! • You can link to this comment

    I added this tag but still my next page is not showing… what could be the reason?

    Reply

    Your words are your own, so be nice and helpful if you can. If this is the first time you're posting a comment, it might go into moderation. Don't worry, it's not lost, so there's no need to repost it! We accept clean XHTML in comments, but don't overdo it please.

    Current day month ye@r *