Support » Fixing WordPress » Pages with identical slugs

  • I have a site where I use pages and subpages with numerical slugs. For example,,, etc.

    This used to work fine, but after upgrading to WP3.0, whenever I edit a page, the slug is automatically changed to be unique (e.g., 1-2 instead of 1).

    Is there any way I can retain the identical slugs?

Viewing 6 replies - 1 through 6 (of 6 total)
  • You can try manually editing the slugs before you save the posts… It would be interesting to hear if this actually works for you

    I’ve tried that. If I try to manually change the slugs back to what I want, the changes are not retained. This used to be the case only when there was another slug at the same level (e.g., you couldn’t have two top-level pages with the same slug). But now it seems to be the case regardless of where the pages are in the hierarchy.

    I am not sure what to tell you other than WordPress must have found some very compelling reason to make sure that the slugs are always unique. Sorry to not have a better answer for you.

    I’ve discovered that the problem is not identical stubs but numerical stubs. Apparently WP no longer allows purely numerical stubs. There is a bug report at and a supposed fix at But the bug report is for an old version (2.3.1) and I’ve been using numeric stubs with 2.9.2 with no problems. Also, the plugin does not seem to fix the problem with WP3.0.

    Update. This is the change that caused the problem:
    The problem goes away if I manually revert to the original code, although this is a bit hacky for my liking. It would be nice if someone produced a plug-in to do the same, but that is beyond my php skills.

    The only way I see it being possible to capture this is right after it happens, with the pre_post_update action.

    You would have to access the variables (this is VERY hackish and not proven):
    global $post_name;
    global $postarr;

    //get the pre-defined slug from the $postarr
    //set the $post_name to the slug you want

    This may or may not work.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Pages with identical slugs’ is closed to new replies.