Title: WP-PageNavi
Author: Lester Chan
Published: <strong>January 3, 2006</strong>
Last modified: July 25, 2026

---

Search plugins

![](https://ps.w.org/wp-pagenavi/assets/banner-772x250.jpg?rev=1206758)

![](https://ps.w.org/wp-pagenavi/assets/icon.svg?rev=977997)

# WP-PageNavi

 By [Lester Chan](https://profiles.wordpress.org/gamerz/)

[Download](https://downloads.wordpress.org/plugin/wp-pagenavi.2.94.6.zip)

 * [Details](https://wordpress.org/plugins/wp-pagenavi/#description)
 * [Reviews](https://wordpress.org/plugins/wp-pagenavi/#reviews)
 * [Development](https://wordpress.org/plugins/wp-pagenavi/#developers)

 [Support](https://wordpress.org/support/plugin/wp-pagenavi/)

## Description

Want to replace the old _← Older posts | Newer posts →_ links with some page links?

This plugin provides the `wp_pagenavi()` template tag which generates fancy pagination
links.

### Usage

In your theme, you need to find calls to next_posts_link() and previous_posts_link()
and replace them.

In the Twentyten theme, it looks like this:

    ```
    <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' ) ); ?></div>
    <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div>
    ```

You would replace those two lines with this:

    ```
    <?php wp_pagenavi(); ?>
    ```

For multipart pages, you would look for code like this:

    ```
    <?php wp_link_pages( ... ); ?>
    ```

and replace it with this:

    ```
    <?php wp_pagenavi( array( 'type' => 'multipart' ) ); ?>
    ```

Go to _WP-Admin -> Settings -> PageNavi_ for configuration.

### Changing the CSS

If you need to configure the CSS style of WP-PageNavi, you can copy the `pagenavi-
css.css` file from the plugin directory to your theme’s directory and make your 
modifications there. This way, you won’t lose your changes when you update the plugin.

Alternatively, you can uncheck the “Use pagenavi.css?” option from the settings 
page and add the styles to your theme’s style.css file directly.

### Changing Class Names

There are [filters](https://codex.wordpress.org/Glossary#Filter) that can be used
to change the default class names that are assigned to page navigation elements.

#### Filters

 * `wp_pagenavi_class_pages`
 * `wp_pagenavi_class_first`
 * `wp_pagenavi_class_previouspostslink`
 * `wp_pagenavi_class_extend`
 * `wp_pagenavi_class_smaller`
 * `wp_pagenavi_class_page`
 * `wp_pagenavi_class_current`
 * `wp_pagenavi_class_larger`
 * `wp_pagenavi_class_nextpostslink`
 * `wp_pagenavi_class_last`

#### Filter Usage

    ```
    // Simple Usage - 1 callback per filter
    add_filter('wp_pagenavi_class_previouspostslink', 'theme_pagination_previouspostslink_class');
    add_filter('wp_pagenavi_class_nextpostslink', 'theme_pagination_nextpostslink_class');
    add_filter('wp_pagenavi_class_page', 'theme_pagination_page_class');

    function theme_pagination_previouspostslink_class($class_name) {
      return 'pagination__control-link pagination__control-link--previous';
    }

    function theme_pagination_nextpostslink_class($class_name) {
      return 'pagination__control-link pagination__control-link--next';
    }

    function theme_pagination_page_class($class_name) {
      return 'pagination__current-page';
    }


    // More Concise Usage - 1 callback for all filters
    add_filter('wp_pagenavi_class_previouspostslink', 'theme_pagination_class');
    add_filter('wp_pagenavi_class_nextpostslink', 'theme_pagination_class');
    add_filter('wp_pagenavi_class_page', 'theme_pagination_class');

    function theme_pagination_class($class_name) {
      switch($class_name) {
        case 'previouspostslink':
          $class_name = 'pagination__control-link pagination__control-link--previous';
          break;
        case 'nextpostslink':
          $class_name = 'pagination__control-link pagination__control-link--next';
          break;
        case 'page':
          $class_name = 'pagination__current'
          break;
      }
      return $class_name;
    }
    ```

### Development

 * [https://github.com/lesterchan/wp-pagenavi](https://github.com/lesterchan/wp-pagenavi)

### Credits

 * Plugin icon by [SimpleIcon](http://www.simpleicon.com) from [Flaticon](http://www.flaticon.com)

### Donations

I spent most of my free time creating, updating, maintaining and supporting these
plugins, if you really love my plugins and could spare me a couple of bucks, I will
really appreciate it. If not feel free to use it without any obligations.

## Screenshots

[⌊With Custom Styling⌉⌊With Custom Styling⌉[

With Custom Styling

[⌊Admin - Options Page⌉⌊Admin - Options Page⌉[

Admin – Options Page

## FAQ

### Error on activation: “Parse error: syntax error, unexpected…”

Make sure your host is running PHP 5. The only foolproof way to do this is to add
this line to wp-config.php (after the opening `<?php` tag):

    ```
    var_dump(PHP_VERSION);
    ```

### When I go to page 2, I see the same posts as on page 1!

You’re using `query_posts()` wrong. See [The Right Way To use query_posts()](http://scribu.net/wordpress/wp-pagenavi/right-way-to-use-query_posts.html)

### Does PageNavi work with secondary WP_Query instances?

Yes; read [this tutorial](http://scribu.net/wordpress/wp-pagenavi/wpn-2-74.html)

### How do I ignore the options page?

If you are running a multi-language plugin, you will probably want to ignore the
strings in the options page.

You can do that like so:

    ```
    <?php wp_pagenavi( array( 'options' => PageNavi_Core::$options->get_defaults() ) ); ?>
    ```

## Reviews

![](https://secure.gravatar.com/avatar/47306efade0467efd5ba9965c61c483d26c67cec78557d994ce80ac8a6429522?
s=60&d=retro&r=g)

### 󠀁[Amazing](https://wordpress.org/support/topic/amazing-4101/)󠁿

 [assad19](https://profiles.wordpress.org/assad19/) March 6, 2025

Amazing Plugin.Thanks 🙂

![](https://secure.gravatar.com/avatar/65b6a1a0a4357f614514b5e2dfbb55d3fecd3faa70039213c672fee1a615b7cf?
s=60&d=retro&r=g)

### 󠀁[Works like a charm](https://wordpress.org/support/topic/works-like-a-charm-2357/)󠁿

 [paulc123](https://profiles.wordpress.org/paulc123/) October 16, 2024

Installed this on all my sites for years.

![](https://secure.gravatar.com/avatar/61b24212c4c3dca853c6f6342d53df6506af7626107822916895d4425744dd0c?
s=60&d=retro&r=g)

### 󠀁[Perfect and very useful plugin](https://wordpress.org/support/topic/perfect-and-very-useful-plugin-3/)󠁿

 [SASCoLtd](https://profiles.wordpress.org/sascoltd/) September 2, 2023

This plugin is perfect and very useful to those who are use custom themes like mine.
Recommended

![](https://secure.gravatar.com/avatar/8a6ded65652fd81eb0510cb4c5710e4e43857d5151ee7b92c53b11284b15f0c6?
s=60&d=retro&r=g)

### 󠀁[Indispensável](https://wordpress.org/support/topic/indispensavel-20/)󠁿

 [amiltonsousa](https://profiles.wordpress.org/amiltonsousa/) August 17, 2023

Simples e totalmente funcional. Resolvendo o problema de paginação com extrema facilidade.
Parabéns aos devs.

![](https://secure.gravatar.com/avatar/0247bd140169f602f8232bbd847d687d618daf0bc6d91cdf7bb5823f15f124f1?
s=60&d=retro&r=g)

### 󠀁[Carefull with the slugs](https://wordpress.org/support/topic/carefull-with-the-slugs/)󠁿

 [jesusjeco](https://profiles.wordpress.org/jesusjeco/) November 22, 2022

I am using this plugin + Divi. It works just fine, but there is a bug with the slugs
of the pages and the post types. If you have, for example, a post type with the 
slug “speakers” and your page is also call “speakers”, both slugs will be the same
and this is causing the plugin to break. Most people on the internet are looking
for this error as the page/2 error. Be sure the slugs does not match and it will
work just fine.

![](https://secure.gravatar.com/avatar/50e5c6d494e8ad9f915ed5b20829a5426b8185aa7b9d2014b9c8087494fafc51?
s=60&d=retro&r=g)

### 󠀁[Required plugin for displaying post list](https://wordpress.org/support/topic/required-plugin-for-displaying-post-list/)󠁿

 [Senri Miura](https://profiles.wordpress.org/senribb/) August 17, 2022

A simple and excellent plugin. The display of the blog list becomes much smarter,
so it is very useful. Currently, I’ve been using in combination with “Styles For
WP Pagenavi Addon”.

 [ Read all 149 reviews ](https://wordpress.org/support/plugin/wp-pagenavi/reviews/)

## Contributors & Developers

“WP-PageNavi” is open source software. The following people have contributed to 
this plugin.

Contributors

 *   [ Lester Chan ](https://profiles.wordpress.org/gamerz/)
 *   [ scribu ](https://profiles.wordpress.org/scribu/)

“WP-PageNavi” has been translated into 53 locales. Thank you to [the translators](https://translate.wordpress.org/projects/wp-plugins/wp-pagenavi/contributors)
for their contributions.

[Translate “WP-PageNavi” into your language.](https://translate.wordpress.org/projects/wp-plugins/wp-pagenavi)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/wp-pagenavi/), check
out the [SVN repository](https://plugins.svn.wordpress.org/wp-pagenavi/), or subscribe
to the [development log](https://plugins.trac.wordpress.org/log/wp-pagenavi/) by
[RSS](https://plugins.trac.wordpress.org/log/wp-pagenavi/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

### 2.94.6

 * NEW: WordPress 7.0
 * FIXED: Escape class names and wrapper attributes on output
 * FIXED: Sanitize navigation text with wp_kses_post when rendering
 * FIXED: Remove unused test.php debug template

### 2.94.5

 * FIXED: WP SCB Framework now uses init hook again

### 2.94.4

 * FIXED: Revert WP SCB Framework to use plugins_loaded hook

### 2.94.3

 * FIXED: Update WP SCB Framework to fix load_textdomain_just_in_time warning
 * FIXED: Remove load_plugin_textdomain since it is no longer needed since WP 4.6

### 2.94.2

 * FIXED: load_plugin_textdomain to be called during init

### 2.94.1

 * FIXED: PHP 8.2 warnings

### 2.94.0

 * NEW: Add args param on wp_pagenavi filter. Props @asadowski10
 * NEW: Improve accessibility of nav links. Props @carlabobak

### 2.93.4

 * FIXED: Update SCB Framework To Support PHP 8

### 2.93.3

 * FIXED: Update SCB Framework To Remove contextual_help

### 2.93.2

 * NEW: Bumped to WordPress 5.4
 * FIXED: Ensure Action Links is always an array

### 2.93.1

 * FIXED: Duplicated Settings Saved admin_notices

### 2.93

 * Remove screen_icon from SCB.

### 2.92

 * Add title attr to pages link. Props @Mahjouba91.

### 2.91

 * Validate text option against kses
 * Update SCB Framework

### 2.90

 * Remove po/mo files from the plugin
 * Use translate.wordpress.org to translate the plugin

### 2.89.1

 * FIXED: before and after args

### 2.89

 * NEW: wrapper_tag option to allow other HTML tag besides DIV and wrapper_class
   option to allow other class name besides wp-pagenavi. Props @Mahjouba91.

### 2.88

 * NEW: Added filters for altering class names. Props @bookwyrm

### 2.87

 * NEW: Uses WordPress native uninstall.php

### 2.86

 * NEW: Bump to 4.0
 * NEW: Added rel=next and rel=previous

### 2.85

 * FIXED: “Use pagenavi-css.css” & “Always Show Page Navigation” in the options 
   are not being saved

### 2.84

 * FIXED: Updated scb framework to fix scbAdminPage incompatible error

### 2.83

 * added ‘echo’ parameter
 * added Estonian and Bengali translations
 * updated scbFramework

### 2.82

 * fixed prev/next links not appearing in some conditions
 * added Hebrew, Georgian and Azerbaijani translations
 * updated scbFramework

### 2.81

 * require an explicit type; fixes bugs with multipart pages

### 2.80

 * support for multi-part pages and user queries
 * moved prev/next links before/after first/last links
 * [more info](http://scribu.net/wordpress/wp-pagenavi/wpn-2-80.html)

### 2.74 (2011-02-17)

 * added ‘smaller’ and ‘larger’ classes
 * added $query arg to wp_pagenavi()
 * updated translations
 * [more info](http://scribu.net/wordpress/wp-pagenavi/wpn-2-74.html)

## Meta

 *  Version **2.94.6**
 *  Last updated **7 days ago**
 *  Active installations **500,000+**
 *  WordPress version ** 4.6 or higher **
 *  Tested up to **7.0.2**
 *  Languages
 * [Albanian](https://sq.wordpress.org/plugins/wp-pagenavi/), [Arabic](https://ar.wordpress.org/plugins/wp-pagenavi/),
   [Bulgarian](https://bg.wordpress.org/plugins/wp-pagenavi/), [Catalan](https://ca.wordpress.org/plugins/wp-pagenavi/),
   [Chinese (China)](https://cn.wordpress.org/plugins/wp-pagenavi/), [Chinese (Hong Kong)](https://zh-hk.wordpress.org/plugins/wp-pagenavi/),
   [Chinese (Taiwan)](https://tw.wordpress.org/plugins/wp-pagenavi/), [Croatian](https://hr.wordpress.org/plugins/wp-pagenavi/),
   [Czech](https://cs.wordpress.org/plugins/wp-pagenavi/), [Danish](https://da.wordpress.org/plugins/wp-pagenavi/),
   [Dutch](https://nl.wordpress.org/plugins/wp-pagenavi/), [Dutch (Belgium)](https://nl-be.wordpress.org/plugins/wp-pagenavi/),
   [English (Australia)](https://en-au.wordpress.org/plugins/wp-pagenavi/), [English (Canada)](https://en-ca.wordpress.org/plugins/wp-pagenavi/),
   [English (New Zealand)](https://en-nz.wordpress.org/plugins/wp-pagenavi/), [English (South Africa)](https://en-za.wordpress.org/plugins/wp-pagenavi/),
   [English (UK)](https://en-gb.wordpress.org/plugins/wp-pagenavi/), [English (US)](https://wordpress.org/plugins/wp-pagenavi/),
   [Estonian](https://et.wordpress.org/plugins/wp-pagenavi/), [Finnish](https://fi.wordpress.org/plugins/wp-pagenavi/),
   [French (Canada)](https://fr-ca.wordpress.org/plugins/wp-pagenavi/), [French (France)](https://fr.wordpress.org/plugins/wp-pagenavi/),
   [Galician](https://gl.wordpress.org/plugins/wp-pagenavi/), [German](https://de.wordpress.org/plugins/wp-pagenavi/),
   [Greek](https://el.wordpress.org/plugins/wp-pagenavi/), [Hebrew](https://he.wordpress.org/plugins/wp-pagenavi/),
   [Hindi](https://hi.wordpress.org/plugins/wp-pagenavi/), [Hungarian](https://hu.wordpress.org/plugins/wp-pagenavi/),
   [Icelandic](https://is.wordpress.org/plugins/wp-pagenavi/), [Indonesian](https://id.wordpress.org/plugins/wp-pagenavi/),
   [Italian](https://it.wordpress.org/plugins/wp-pagenavi/), [Japanese](https://ja.wordpress.org/plugins/wp-pagenavi/),
   [Khmer](https://km.wordpress.org/plugins/wp-pagenavi/), [Korean](https://ko.wordpress.org/plugins/wp-pagenavi/),
   [Latvian](https://lv.wordpress.org/plugins/wp-pagenavi/), [Lithuanian](https://lt.wordpress.org/plugins/wp-pagenavi/),
   [Norwegian (Bokmål)](https://nb.wordpress.org/plugins/wp-pagenavi/), [Persian](https://fa.wordpress.org/plugins/wp-pagenavi/),
   [Polish](https://pl.wordpress.org/plugins/wp-pagenavi/), [Portuguese (Angola)](https://pt-ao.wordpress.org/plugins/wp-pagenavi/),
   [Portuguese (Brazil)](https://br.wordpress.org/plugins/wp-pagenavi/), [Portuguese (Portugal)](https://pt.wordpress.org/plugins/wp-pagenavi/),
   [Romanian](https://ro.wordpress.org/plugins/wp-pagenavi/), [Russian](https://ru.wordpress.org/plugins/wp-pagenavi/),
   [Serbian](https://sr.wordpress.org/plugins/wp-pagenavi/), [Slovak](https://sk.wordpress.org/plugins/wp-pagenavi/),
   [Spanish (Chile)](https://cl.wordpress.org/plugins/wp-pagenavi/), [Spanish (Mexico)](https://es-mx.wordpress.org/plugins/wp-pagenavi/),
   [Spanish (Spain)](https://es.wordpress.org/plugins/wp-pagenavi/), [Spanish (Venezuela)](https://ve.wordpress.org/plugins/wp-pagenavi/),
   [Swedish](https://sv.wordpress.org/plugins/wp-pagenavi/), [Turkish](https://tr.wordpress.org/plugins/wp-pagenavi/),
   [Ukrainian](https://uk.wordpress.org/plugins/wp-pagenavi/), and [Vietnamese](https://vi.wordpress.org/plugins/wp-pagenavi/).
 *  [Translate into your language](https://translate.wordpress.org/projects/wp-plugins/wp-pagenavi)
 * Tags
 * [navigation](https://wordpress.org/plugins/tags/navigation/)[pages](https://wordpress.org/plugins/tags/pages/)
   [pagination](https://wordpress.org/plugins/tags/pagination/)[paging](https://wordpress.org/plugins/tags/paging/)
 *  [Advanced View](https://wordpress.org/plugins/wp-pagenavi/advanced/)

## Ratings

 4.7 out of 5 stars.

 *  [  127 5-star reviews     ](https://wordpress.org/support/plugin/wp-pagenavi/reviews/?filter=5)
 *  [  11 4-star reviews     ](https://wordpress.org/support/plugin/wp-pagenavi/reviews/?filter=4)
 *  [  2 3-star reviews     ](https://wordpress.org/support/plugin/wp-pagenavi/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/wp-pagenavi/reviews/?filter=2)
 *  [  9 1-star reviews     ](https://wordpress.org/support/plugin/wp-pagenavi/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/wp-pagenavi/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/wp-pagenavi/reviews/)

## Contributors

 *   [ Lester Chan ](https://profiles.wordpress.org/gamerz/)
 *   [ scribu ](https://profiles.wordpress.org/scribu/)

## Support

Issues resolved in last two months:

     0 out of 2

 [View support forum](https://wordpress.org/support/plugin/wp-pagenavi/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://lesterchan.net/site/donation/)