• Hi everyone,

    Currently the ID reveals the order in which posts/pages were created. This is why I would prefer to have random IDs or at least I would like to be able to set each post’s/page’s ID. How could this be done? Maybe with a one-way function? Or maybe there’s a plug-in that maps a random public ID to the internal one?

    Many thanks!

Viewing 12 replies - 1 through 12 (of 12 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    You can’t renumber them, but towards what end are you wanting to do this? I’m assuming you want to reorder them on a front end menu or something?

    Thread Starter elastisch

    (@elastisch)

    I don’t want to renumber; I would like to hide the IDs by using a plug-in (via mapping or something) OR (rather for a new blog) I would like to have a random ID for each posting/page (or be able to pick one) instead of an autoincremented one.

    Intention: to hide in which order posts/pages were created.

    Maybe I should have asked in “plug-ins and hacks” forum? Shall I Xpost?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    No no I can move it if we need to but… Why? Seriously, the answers change ??

    I mean, there’s no reason for it, and the IDs are needed in the order they’re in for the back end of WordPress. Are you trying to hide the IDs from viewers or something?

    Thread Starter elastisch

    (@elastisch)

    With a vanilla WP the IDs can’t be hidden effectively, AFAIK. You can always loop through N on https://www.example.com/?p=N .

    For me it’s a privacy issue. I don’t want people to be able to estimate what is going on behind the scenes of my site, how many drafts/revisions I’m on, what articles were started before article N. That’s all more or less. Enough reason for me. Hope you can understand.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    I do understand, but I preface this by warning you that you will not like my answers.

    The explanation does help, and it’ll stop us from chasing the wrong rabbits. You’re never going to be able to do that. The page and post IDs actually use the same incremental counter (and IIRC, attachments do as well). To change that would require a serious recoding of the entire product.

    Now. Obviously you can hide them via pretty permalinks, but you’re right in that https://www.example.com/?p=N will continue to work. And you need it to for other reasons on the back-end (like a post preview) so you shouldn’t even toss in a redirect for ?p to go anywhere else.

    At best, by limiting revisions saved, you can throw things off a little, and maybe by using a shortlink generator you can throw it off more, but complete disabling won’t work. This will be true of most (if not all) CMS tools.

    Thread Starter elastisch

    (@elastisch)

    Thanks for you reply. I already guessed that it would mean some core hacking. Maybe I’ll look into it. Maybe it just means coding a function that generates a random ID and checks if it’s unused. *optimisticthinking*

    In the first place I was just wondering if nobody else had a problem with the way IDs are employed/deployed.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Yeah, it’s not considered a problem since we know that database tables require an incremental update no matter what. I’ve never had a need for privacy with knowing when a post showed up in the DB, since there would be hundreds of ‘misses’ thanks to revisions. At best you could assure yourself of finding a ?p=1 on a brand new site, but that won’t work on mine since I deleted Hello World ??

    For me it’s a privacy issue. I don’t want people to be able to estimate what is going on behind the scenes of my site, how many drafts/revisions I’m on, what articles were started before article N. (elastisch)

    I’m totally with you, there. Sequential numbering is one of the reasons I rarely use post IDs in the prettified URL. On my anonymous rants-only blog I sometimes start an article but then decide I need to do some/more research, and the research spawns more articles, and sometimes they take months to finish to my satisfaction. I don’t always want people to know that post #238 somehow comes before post #79 :p

    Thread Starter elastisch

    (@elastisch)

    I often even (have to) use the post ID in the prettified URL because my authors sometimes change the slug (especially when they make typos like “obama” instead of “osama” and vice versa) and then WordPress’ automatic redirect sometimes would end up pointing to the wrong post.

    Any chance this feature (random ID numbering) could end up in WP? Or maybe move this topic to “plugins and hacks” or “hacks”? Thanks.

    I don’t see this ever making it into WP.

    Thread Starter elastisch

    (@elastisch)

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    It’s value, in so far as WordPress posts and pages (and users and comments) go is minimal. You won’t see this in WP, they’re not going to spend time on this because while there is A need, there isn’t ENOUGH need and there is WAY too much work.

    If it’s that huge an issue that you MUST keep those things obfuscated, you need either a custom CMS or an impressive plugin.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘random post-IDs instead of auto_incremented ones’ is closed to new replies.