Home » Wordpress » Rewrite (translate) paged part of a URL in WordPress

Rewrite (translate) paged part of a URL in WordPress

Posted by: admin November 30, 2017 Leave a comment

Questions:

I would like to translate the paged part of a URL, like so:
currently: mysite.com/page/2
I would like: mysite.com/p/2

Does anybody know of a filter to do this?
Or would a custom rewrite be more appropriate? If yes, how?

Thanks,
Regards.

Answers:

OK add this below code in your theme function.php file

and reset you permalink

add_action( 'init', 'my_custom_page_word' );
function my_custom_page_word() {
global $wp_rewrite;
$wp_rewrite->pagination_base = "p";
}

Thank you
Manzurul