I have a site where attachments in the wp_posts table have guid values of guid, how did this happen?

I realise comparing this particular website with all the other WP sites I've built that all the others have the image url in the guid column of the wp_posts table, yet this problem site just has "guid" as the value of the guid column for ALL it's image/attachment entries.

The site still seems to work fine... if I go to the "Media" area of the admin it lists all the uploaded images correctly. I assume the code is looking at the "_wp_attachment_metadata" fields in wp_postmeta to obtain their urls.

Ideally I want to

  1. know how this happened - ie is this by design in some scenarios? was there a bug in WP at some point causing this?
  2. Correct the issue replacing these values with the image urls as I have a function that tries to determine the image id of an image from it's url and that fails on this site (based on this code).

Topic guids attachments images posts Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.