WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can this function...

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

...be somehow used to change the from of the url from "page/2/" not to "p/2/" but to "?p=2"?

share|improve this question

I am not entirely sure what you are asking but that ?p= pattern is a raw query string. That is, that is what you get without pretty permalinks at all.

Go to Settings->Permalinks in wp-admin and select the default permalinks. Save and you are done. You don't need any other function. If that doesn't solve it you need to rewrite your question so that it is more clear.

share|improve this answer
Indeed, but I'd rather have in this form only for pagination, just like with the other exception - search. – user23068 Apr 25 '13 at 20:52
You can pass $_GET strings to a WordPress page but what you are trying to do is pass or manipulate query strings/parameters that are built into the WordPress core. ?p= is the WordPress Core parameter for "post ID = N". I expect, it is going to be a long hard road to alter that. – s_ha_dum Apr 25 '13 at 20:56
Not necessarily, it was just a bad example, any word will do, such as "page". I was just wondering if this function could be used, with some method to remove the slash (now the result is "?page=/2) – user23068 Apr 25 '13 at 22:59
Ok. So... can you think through what you want and clarify the question very carefully? I'd rather not keep guessing. – s_ha_dum Apr 25 '13 at 23:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.