[wp-hackers] GUID problem
eric at eamann.com
Wed Sep 1 16:26:27 UTC 2010
This is the problem inherent in using a URL as a GUID. Even though multiple
posts might have the same post number (?p=57) I doubt they have the same full
GUID. Try not to think of the GUID as a URL, even though it *looks* like a URL.
http://blog.url/?p=57 and http://localhost/?p=57 really are different GUIDs
that refer to different posts ... even if one is post ID 57 and one is post ID
192, the GUID doesn't change.
For this reason, you shouldn't use the GUID as a short URL ... since the GUID
itself is a URL. So I don't know what exact use case your client wants, but
that doesn't make sense.
To make sure GUIDs read as unique, maybe we should consider hashing the URL form
instead of storing it as a URL. This way no one will confuse a GUID with an
actual post URL ... particularly when moving from site to site.
On September 1, 2010 at 4:03 PM Lynne Pope <lynne.pope at gmail.com> wrote:
> Hi all,
> The GUID *should* be unique within a blog - right? Well, I have a problem
> and am hoping someone has ideas on how to solve it (apart from manually
> modifying the GUID field).
> I am currently working on a blog that has been using WordPress for the past
> 5 years. It contains over 1,000 posts. Over that time, the blog has had
> several changes, including domain names, and the merger of other blogs into
> this one. The GUID has five different domain names, including localhost, but
> that isn't the issue (they can be easily changed with a couple of SQL
> queries). The problem is, the unique identifying number isn't unique. ?p=57
> occurs multiple times, for example.
> They want this fixed, and also want to use the GUID as a short URL on their
> new site, which makes it imperative that the GUID really is a unique
> Has anyone come across this before? Does anyone know of a way in which to
> renumber the GUID's so they are unique and correctly incremental?
> I'd appreciate any advice you can offer.
> Lynne Pope
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers