0

I want to remove page slug for all pagings.

For home page

  • Old: www.x.com/page/4
  • New: www.x.com/4

For Category page

  • Old: www.x.com/category1/page/4
  • New: www.x.com/category1/3

How can I achieve it? Or is there any simple plugin for it?

3
  • You may find your answer here. Change the “page” slug in pagination
    – Robert hue
    Commented Oct 28, 2014 at 6:22
  • Bu this is not "change" question does using this strategy for "removing" creates side effect? Commented Oct 28, 2014 at 7:01
  • You could edit the WP database directly (after backing it up) if you can't find a plugin.
    – user4849
    Commented Oct 28, 2014 at 16:48

1 Answer 1

-1

Add this code to your functions.php and please re-save your permanent link page and do not forget 301 redirects

add_action( 'init', 'remove_page' );

function remove_page(){
    global $wp_rewrite; $wp_rewrite->pagination_base = "";
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.