Question

As the title says, I'm using an API to fetch some data which is used to create CPT posts, and need to identify items returned from the API which have already been inserted as posts.

The API returns unique IDs for each item, which naturally leads me toward just making use of the GUID column, but I've read, in no uncertain terms, to never make use of the GUID.

If touching the GUID is taboo, is there an accepted standard practice for doing this? Preferably without adding tables/columns to the database?

Was it helpful?

Solution

Never use GUIDs in WordPress, you definitely got that right.

However nothing prevents you use concept of unique identifiers. You already have values for them, just ignore native column and store them in post meta as arbitrary data. On import you can check for that.

For crazy volume it might require some performance tweaking but generally it holds up.

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top