[wp-hackers] Avoiding GUID collisions

DD32 wordpress at dd32.id.au
Sun Feb 1 06:42:09 GMT 2009


You can certainly hook in somewhere and set the Guid to md5(time() .
microtime()); if you want.. I believe the Guids were changed to use
the non-pretty permalinks so that they wouldnt change, and so that
people who were currently using them as a permalink wouldnt end up
with completely broken links.

Yes, People would probably get a duplicated item in their inbox if
their client bases it off the Guid, Some base it off  a hash of the
other details (As theres some which do not supply a guid, or supply a
non-unique guid).. But theres a limited number of items in the rss
feed, from memory, 10-15ish so it wouldnt be a huge duplication.. Most
scrapers wouldnt remember previous items either.

One thing i do, is i dont use localhost, at all.
I use xxxx.dev.dd32.id.au, Each domain is a seperate site in my apache
install, You can set up virtualhosts so that it maps xxx to
www-home/sites/xxxx/ too, which speeds up setting things up. (Thats
assuming you can add a Wildcard DNS entry for the domain..)

2009/2/1 Lynne Pope <lynne.pope at gmail.com>:
> Hi all,
> Anyone know of any way to avoid issues with WP's guid's? Also, how to avoid
> issues with feeds if the guid's are changed?
>
> Note - I am looking for a code solution, not support for fixing a user
> problem!
>
> I encountered some issues with this scenario...
>
> 4 x blogs, all created locally then uploaded to the server.
> Time passed, I decided to take down 3 blogs and move some content from each
> of these into blog #4.
> guid's of http://localhost/blog/?p=ID were not a problem on each individual
> blog. However, on pulling the posts into the last blog I found that this URI
> was duplicated and sometimes triplicated.
>
> This defeats the purpose of a GUID, which should be a unique identifier.
>
> I've run an SQL query to change all guid's to the new domain with the ID
> taken from the post ID. This recreates a unique guid but I am unsure of the
> implications for feeds.
>
> The blogs I took down had content dating way back, and had come from
> b2\cafelog and Nuke before that. Due to the massive amount of data I didn't
> attempt to combine the databases to keep ID's soomewhat related to date
> order. And due to the revisions in WP 2.6, the ID's climbed exponentially.
> This means that ID's for recent content from blog 1 are in some cases
> considerably lower than ID's for old content from blog 2.
>
> With the change to the GUID is this likely to see the feeds from the new
> domain throwing out really old content now?
>
> Apart from that issue, I am concerned that sites I develop locally for
> clients could run into the same issues should any clients decided to migrate
> content from, say, company blog A and company blog B to company blog C.  If
> I have managed to have so-called unique guid's being replicated for
> different content others are bound to run into this too.
>
> Lynne
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list