How To Add Next Post & Previous Post Links on Your Wordpress Blog
Site engagement is a very important metric in Search Engine Optimization (SEO). How much average time does visitor spend on a page is called as an "Engagement". By adding external links, high-quality posts links on the sidebar, thumbnails are the methods by which you can achieve this goal.

Adding “Next Post” and “Previous Posts” will exactly do the same. And if you could add relevant next and previous pages or add posts subject line below it, it will gain much attention. Technically with this tip you can expect almost double time which visitor spend on the page. With such additional tricks, you will give visitor more opportunities to surf on your site’s other attractive parts. Redirecting and engaging them on site to such relevant pages is a key.

In this article, you will learn to add Previous Post and Next Post links on your blog sit below posts or at any place you want.

Also see, Latest RSS Feed Directory Submission Sites 2015

Note: Before making any changes in Blog's template, make sure to take a backup. cPanel has easy backing up option available.

Follow the easy steps on Wordpress-
In your Wordpress dashboard, go to Appearance >Themes > Editor
At right sidebar, click single.php

Find this line <?php comments_template ?>
Do Ctrl+F for easy searching.

Add below set of codes below it by using Enter once.

<span style="text-align: center;">Where next?</span></h3>
<span><?php previous_post_link(); ?></span> <span style="float: right;"><?php next_post_link();

You can surely modify above codes to add more designs using CSS.

Customize Next and Previous Post Links -

You can add options by calling next_post_link and previous_post_link with options

next_post_link('format', 'link', 'in_same_cat', 'excluded_categories');

E.g. To only extract pages from the same category, exclude category number 2, and to always use "Next->", Post title in Bold for text of link use code such as -

next_post_link('%link', 'Next-><strong>%link</strong>', TRUE, '2');
in place of next_post_link();

It is recommended to use text links instead of image thumbnails for better SEO results. But if you want to use images make sure to use ‘alt’ tags.

You may also like, Use your saved bookmarks online anywhere - Productivity tools.

Save the file and refresh your website. If you do not like the changes just use the backup file and restore your site changes using Wordpress settings or cPanel. More specific pages which will require specific links to redirect will need separate .php files. You will need to find those .php files which will redirect those pages. Most of the cases there will be a single file. In the special case where there are different areas to direct use customization explained above.

e.g. If you have a news site and wish to add above links in Sports section, you will need to use samplesitenews.php file to add with these HTML codes and so on.

You can also add class to links generated by next_posts_link which works in an efficient manner.

add_filter('next_posts_link_attributes', 'posts_link_attributes');
add_filter('previous_posts_link_attributes', 'posts_link_attributes');

function posts_link_attributes() {
    return 'class="styled-button"';

Comment with Facebook

No more post found.