Timeline for Are post ID's reliable?
Current License: CC BY-SA 3.0
15 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 24, 2020 at 13:06 | vote | accept | Qix - MONICA WAS MISTREATED | ||
Nov 25, 2015 at 13:36 | comment | added | Magne | In my answer to this question I added some additional detail regarding Multisites, which might settle this discussion: wordpress.stackexchange.com/a/209833/71131 | |
Oct 12, 2014 at 12:32 | comment | added | Mark Kaplun | @JohannesPille, since this is not a competition, I don't feel bad about not winning more votes :) (actually surprised there was only one down vote). I think you just answered too fast before asking about the context of the question as if he wants to be able to export the data the the ID is not reliable, and that was my answer - ID is not reliable for all possible uses. | |
Oct 12, 2014 at 11:33 | comment | added | Johannes Pille | When I initially read your update I was about to cave and agree. However the following notion of yours: "You can also create a post via code to reuse some "old" ID." equally applies to the GUID. "You can also change a post's guid via code." With (bad) code you can break anything. Which makes this part of your argument as invalid as it can get. | |
Oct 10, 2014 at 3:48 | comment | added | Mark Kaplun | ID is just a number with no assigned meaning, unlike a Global Unique IDentifier. Just because so many people are guilty in not understanding GUID and thinking it is a URL doesn't make ID more reliable then it is, it just makes GUID less reliable. | |
Oct 10, 2014 at 1:43 | comment | added | guidod | As for "ID is not even a standard", not sure what you mean. Having autoincrement IDs on MySQL databases is as standard (de facto, if you will, but standard anyway) as you can get. The GUID will get changed changed if you, or anyone in the future, replace old domain -> new domain in a WordPress database, which many people do (definitely much more often than manually tinkering with the IDs). | |
Oct 9, 2014 at 21:18 | comment | added | Mark Kaplun | hmmm, and of course it doesn't change on export and import and it contains URI not URL. | |
Oct 9, 2014 at 20:58 | comment | added | Mark Kaplun | @guidod, nothing is reliable against bad code which doesn't respect standards.ID is not even a standard. | |
Oct 9, 2014 at 18:45 | comment | added | guidod | The GUID field contains the URL and is often changed when migrating databases and search-replacing the URL in the whole database with something like interconnectit.com/products/… , so it's definitely NOT more reliable than IDs. I agree with @JohannesPille on this one. | |
Oct 8, 2014 at 17:31 | comment | added | Milo | the only reliable aspect of the connection between posts and post meta is that the IDs match each other, not that they remain forever unchanging. | |
Oct 8, 2014 at 13:25 | history | edited | Mark Kaplun | CC BY-SA 3.0 |
added 291 characters in body
|
Oct 8, 2014 at 13:17 | comment | added | Mark Kaplun | It all depends on what level of reliability you need. The uniqueness of the ID is just a byproduct of the auto increment and in no place it is defined as the field that identifies the post, and I totally forgot about it when I wrote the answer, but there is a field that by definition is a unique reliable identifier of the content and it is the guid codex.wordpress.org/Changing_The_Site_URL#Important_GUID_Note | |
Oct 8, 2014 at 11:54 | comment | added | Johannes Pille | Addendum: Data from the wp_postmeta table is connected to posts stored in wp_posts via the post_id field. Not only are post IDs reliable, the core relies on their reliability... | |
Oct 8, 2014 at 11:36 | comment | added | Johannes Pille | I cannot second this. Yes, while one can reuse an "old" ID via code, this would either have to be done by the OP herself or by a second-party plugin. So the pedantic answer remains "Yes, unless you're not asking about just the core, but also second-party code (which as an aside would make the question off-topic)."... | |
Oct 7, 2014 at 22:25 | history | answered | Mark Kaplun | CC BY-SA 3.0 |