[wp-hackers] GUID problem

Mike Schinkel mikeschinkel at newclarity.net
Thu Sep 2 02:17:59 UTC 2010

On Sep 1, 2010, at 9:45 PM, Andrew Nacin wrote:

> On Wed, Sep 1, 2010 at 9:26 PM, Mike Schinkel
> <mikeschinkel at newclarity.net>wrote:
>> On Sep 1, 2010, at 9:14 PM, Lynne Pope wrote:
>>> But, as it is, a developer has used them for his shortlinks and I
>>> am just tasked with the job of cleaning up the database.
>> I'm confused. How cane some use WordPress's GUID for *short* links; aren't
>> WordPress' GUIDs rather long?
> Since 2.5, we've used the non-pretty URL for the GUID, i.e.
> http://example.com/?p=1. (This is the same as a default WP shortlink in
> 3.0.) Some who look at the database schema see a link and feel they can use
> $post->post_guid instead of get_permalink(). It looks like a URL, but it's
> not.. Anyway, there's been proposals to use UUID (something we should
> consider). I've re-opened the related Trac ticket that proposed UUID now
> that our MySQL minimum is high enough.

Ah, thanks for the clarification.  Having seen how much garbage accumulates in that field it never occurred to me that someone would think to grab and use it *directly*.  

Yes, the UUID idea sounds good.  That said, the short-link implementation seems fraught with conflict anytime posts get merged from multiple databases.  Does WordPress' import handle tracking those and fixing them up with 301 redirects? Also, seems like using post_ids is a very fragile solution?


More information about the wp-hackers mailing list