Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor cageehv

    (@cageehv)

    Hey chitaranjan,

    Deleting duplicate custom fields is not a part of the options.

    Besides: if the plugin finds 3 duplicate custom fields for the same page (custom fields with the same name, I mean) which ones to delete?
    The plugin doesn’t know which one has the correct value…

    Hope this answers your question.

    peace,
    Rolf

    Thread Starter Chito

    (@chitaranjanthoudam)

    Sorry it wasn’t so clear from my side. For some reason when we add custom fields by plugin or from database, duplicate custom field with same value went in. So what I was trying to say is if there is duplicate custom field + same value, delete all by leaving one.

    Hope this make sense.

    Plugin Contributor cageehv

    (@cageehv)

    Hey chitaranjan,

    The query to detect these duplicates would be something like:

    SELECT post_id, meta_key, meta_value
    FROM wp_postmeta -- change the prefix to your own prefix
    GROUP BY post_id, meta_key, meta_value
    HAVING count( * ) > 1

    I think it’s not worthwhile to add it to the plugin. It’s too rare in my opinion… and it only would save just a few bytes in the end.

    peace,
    Rolf

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Does this delete duplicate custom fields’ is closed to new replies.