How to Split Long WordPress Posts into Multiple Pages

How can you divide a long WordPress Post into multiple pages, so that the page length is limited, reduced images per page load faster and it is easier for your readers to browse your article without being overwhelmed by the length of the article.

Why Split Articles

So why do you want to split your articles into multiple pages anyway?

1. Extra long posts – If you like to write extra long posts, it is a good idea to split your article into multiple pages as it makes the article more readable, does not overwhelm the reader with the size of the article, and is a good practice for convenient reading especially if you have multiple pages.

2. Increase pageviews – if you divide your article into multiple pages, every page click to the next page will increase your page views. So if you have a very popular article, then why keep it five scroll views long, when it is a better idea to get five page views for one single article instead.

3. Faster loading pages – if your article is loaded with large images and screenshots, they contribute to slow page load times. Slow loading pages lead to poor user experience on your site as the pages continue to load forever image by image. Why not divide this page into multiple pages, reduce images per page and get faster loading pages every time, not to mention an increase in pageviews again contributing to more site traffic.

This is how split WordPress posts and pages look like on our blog

split into multiple pages

We recently started spitting our extra long articles into multiple pages to increase page loading time especially on articles with multiple large  images. You can test this page link features on this article.

Split article into multiple pages

Well WordPress provides some inbuilt functions which can be easily used to divide any new or existing WordPress post into multiple sub pages. The secret code which you have to insert in your WordPress post where you want the article to split is

<!--nextpage-->

When you are editing your WordPress post or writing a new one, simply insert this code in the ‘HTML editor view‘ wherever you want to split the post. Use this code as many times as you want and it will divide your post into that many pages.

WordPress theme support for page links

But remember that your WordPress theme must support the page links feature, otherwise implementing this next page code will not split your article into multiple pages and no page links will be displayed. In fact this will actually only display the first page of your article and there will be no other links to point to other pages in which you divided your article.

If you use a modern WordPress theme, then it should automatically display and support this page links feature. If you use a custom WordPress theme, or an older WordPress theme, then you would need to add some additional PHP code in your single.php file (which displays the single post) to support this feature.

<?php wp_link_pages(); ?>

Remember to add this code below the code where the main content is published <?php the_content();?> as this will display the page links below the article. This code will display all the default arguments and display links to the multiple pages you have created.

If you want to style these links, you can insert this code into div tags and then use any CSS styling you want.
<?php wp_link_pages('before=<div id="stylelinks">&after=</div>'); ?>

Well that’s it, which articles are you going to split up now?

Share with friends

About the Author: P Chandra is editor of QOT, one of India's earliest tech bloggers since 2004. A tech enthusiast with expertise in coding, WordPress, web tools, SEO and DIY hacks.