WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How significant is the guid field in wp_posts?

I'm doing a migration and adding a lot of images to the table (via wp_insert_attachment, wp_generate_attachment_metadata and wp_update_attachment_metadata), but the guid field isn't filled by default.

Should i correct this?

share|improve this question
up vote 2 down vote accepted

If you want to offer an ATOM feed for your attachments you should pass a GUID to wp_insert_attachment() or add a filter for 'get_the_guid' that handles empty values. In most (all?) other cases I wouldn’t care about it.

share|improve this answer
but what is guid for ? – Francisco Corrales Morales Jul 28 '14 at 23:21
@FranciscoCorralesMorales See en.wikipedia.org/wiki/Globally_unique_identifier – it makes it possible to identify a resource. – toscho Jul 29 '14 at 7:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.