How to Change the “page” slug in Pagination of WordPress?

When pagination of www.cheapglasses123.com/blog is activated, the pagination URL will display as “www.cheapglasses123.com/blog/page/2” as default. How can we change the pagination to “cheapglasses123.com/blog/eyeglasses/2”?

Open functions.php, which is under your theme folder. Add the following function at the end of the file:

function re_rewrite_rules() {
global $wp_rewrite;
$wp_rewrite->pagination_base = 'eyeglasses';
$wp_rewrite->flush_rules();
}
add_action('init', 're_rewrite_rules');

done.

Same method, we can modify author_base, search_base,comments_base, as follows:

[code]
function re_rewrite_rules() {
global $wp_rewrite;
// $wp_rewrite->author_base = $author_slug;
// print_r($wp_rewrite);
$wp_rewrite->author_base = ‘writer’;
$wp_rewrite->search_base = ‘search’;
$wp_rewrite->comments_base = ‘reviews’;
$wp_rewrite->pagination_base = ‘eyeglasses’;
$wp_rewrite->flush_rules();
}
add_action(‘init’, ‘re_rewrite_rules’);
[/code]