Modify default WordPress pagination base URL

By default WordPress pagination slug is – /page/[page_number].

How about if we need to change this to something else? Perhaps your site is not in English, and you want pagination in your language?

This is very easily controllable with pagination_base property of WP_Rewrite class.

function careless_rewrite_pagination_slug() {
    global $wp_rewrite;
    $wp_rewrite->pagination_base = 'something-else';//edit something-else to whatever you want 
add_action( 'init', 'careless_rewrite_pagination_slug' );

Code goes in the functions.php file of your active theme.

Now, since we have changed slug/permalink, we need to clear WordPress permalink cache for this change to start working. We can do that using flush_rules property of WP_Rewrite class. But there is no point to call it every time, when our code runs. Instead, we will clear this manually from WP Admin. Head to WP Admin > Settings > Permalinks and click on the Save Changes. You don’t really need to make any change – just a button click. That will clear permalink cache, and our new search slug will start working.