Skip Navigation

[Resolved] Duplicate entries for custom fields discovered in database

This support ticket is created 3 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 3 years, 2 months ago.

Assisted by: Luo Yang.

Author
Posts
#2175235
Screen Shot 2021-09-21 at 10.30.57 AM.png

We have a React app that depends upon the data for the toolset custom fields. We query the database for the result of a specific custom field. The results from this query are then saved to a JSON file for React to read and populate. The issue is that we discovered duplicate entries for this custom field that are not associated with a post.

How do we safely remove duplicates? Any reason this is occurring? Please see the attachment for the SQL query.

#2175771

Hello,

Different posts can have same value in specific field, that might be the reason.

You might try other SQL query to get unique field values, I have searched it in Google, and got some related threads, for example:
https://wordpress.stackexchange.com/questions/196262/list-all-unique-custom-field-values