Support » Fixing WordPress » nextpage tag

  • I am having a problem with the nextpage tag in WP 3.0, and it appears to be a rewrite bug.

    Post url:

    When I click the following pagination link:

    I am redirected back to the original post url.

    Manually loading the following url works fine:

    I’m pretty sure this was not an issue in WP 3 RC1. I can’t remember if I ever tested post pagination in RC2 or RC3.

Viewing 15 replies - 1 through 15 (of 18 total)
  • I still have not found any discussion on this bug.

    After a bit of experimentation, I have discovered that the nextpage rewriting bug is only present when %category% is included in the permalink structure.

    nextpage works with this permalink structure:

    nextpage does not work with this permalink structure:

    After even more experimentation, it seems my last post is not accurate.

    The nextpage tag works fine with the following permalink structure:


    …unless the post belongs to a child category.

    So, a URL of structure:


    will not paginate.

    Did you happen to have any luck fixing this?

    I have the exact same problem, and according to here it seems like /%category%/%postname%/?page=2 works fine. (I’ve tested it as well)..

    Funny though, this has worked on older WP versions, if I’m not wrong..

    Just found out that if the post is in a sub-category and not the main category, it doesn’t work as it should.

    So let’s say you have two categories :
    Category A
    — Category B

    And you’ve posted your post in Category A only, it works.

    If you’ve posted it in Category B only, and it links like this – /category-b/post-name/2 then it works.

    However if you have posted it in Category B only and the link is like this – /category-a/category-b/post-name/2 then it stops working.



    Forum Moderator

    Have you re-tried this using the default permalink settings or one of the common settings?

    With default permalink settings it all works fine.

    For my end it only doesn’t work with custom permalinks (/%category%/%postname%/) – well, I’m not really trying with any other combination 🙂



    Forum Moderator

    I’m afraid you may have hit one of the potential permalink issues that are mentioned in the documentation. A custom structure that begins with a numeric might sidestep the issue.

    Ouch, noted then! Thanks for clarifying, esmi!

    Will just have to wait it out until this is fixed. 🙂

    Oh my god. I got the same problem on WP 3.0

    My site runs like this: /category-a/category-b/post-name/

    So, the pages does not work. All is broken, everything. What should I do to fix it? I mean, all the paged texts (A LOT!)

    Please, someone?

    I already tried the tip on documentation using a post id on the front, same thing.


    Same problem, like noted on

    I use Pagebar2 for multipaging, so my very poor workaround was to edit the function create_link($page) in class-multipagebar.php not to use URLs like /cat/subcat/page/2, but /cat/subcat/page/?page=2

    $link = trailingslashit(get_permalink()) . ‘?page=’ . $page;

    instead of

    if (” == get_option(‘permalink_structure’) || in_array($post->post_status, array(‘draft’, ‘pending’)))
    $link = get_permalink() . ‘&page=’ . $page;
    $link = trailingslashit(get_permalink()) . user_trailingslashit($page, ‘single_paged’);

    But that’s not what I really want… looking forward for a bugfix!

    Did the same fozloki, thanks for the tip.

    I edited the plugin I use, Multi-Page toolkit.

    Using the same technique.

    Now, waiting for a official bugfix.

    @ fozloki

    We have the same Problem here one example:

    FreizeitspaĂź im Albtal

    But now we switch the Code in pagebar2 also to: $link = trailingslashit(get_permalink()) . ‘?page=’ . $page;

    Thankx for this information. 🙂

    I hope that the Problem will fix soon.

    I have the same problem, when clicking on a page link it redirects to the same page… what I did while they solve this bug, remove the nextpage from content before displaying.

    In the single.php:

    $content = $post->post_content;
    $content = str_replace('<!--nextpage-->','-', $content);
    $content = str_replace("\n<!--nextpage-->\n", ' ', $content);
    $content = str_replace("\n<!--nextpage-->", ' ', $content);
    $content = str_replace("<!--nextpage-->\n", ' ', $content);
    $content = apply_filters('the_content', $content);
    echo $content;

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘nextpage tag’ is closed to new replies.