Skip Navigation

[Resolved] Understanding Database Entries

This support ticket is created 4 years, 4 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 4 replies, has 2 voices.

Last updated by julieP 4 years, 4 months ago.

Assisted by: Nigel.

Author
Posts
#1688511

I have a Custom Fields Group called 'Listing Fields'. In the site's postmeta table there are multiple meta keys that seem to follow the format wpcf-CUSTOM FIELDS GROUP NAME-CUSTOM POST SLUG-SEQUENTIAL NUMBER. So for example I see the following meta keys:-
wpcf-listing-fields-listing-1
wpcf-listing-fields-listing-2
wpcf-listing-fields-listing-4

The meta values are serialized data consisting of the custom field names for the custom post type.

What's puzzling me is why are there multiple meta keys like this storing exactly the same data and why is a sequential number skipped (in the above list you can see that wpcf-listing-fields-listing-3 doesn't exist).

From a good housekeeping point of view, I need to understand when/why these keys are created, why it's necessary for multiple keys to store the same data, whether any of them can be routinely removed and how do I ascertain which ones are to safe to remove?

Thank you

#1689657

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I have quite a few sites installed locally, my test sites, and some copies of client sites for open issues I'm working on, some of which are fairly large complex sites.

I performed searches on quite a few of these sites, looking in wp_postmeta for rows with keys matching the pattern you describe (actually, a looser version to be less specific), and found no results, on any of the sites.

I can't say where those entries are coming from on your site.

When you create a custom field group, a post (of type wp_types_group) is created, with details stored in wp_postmeta corresponding to that post, but not with keys in the format you describe.

Have you found these postmeta entries on more than one site, or just a single site?

What kind of posts do these postmeta entries belong to?

How is that content created?

Are you running any custom code on your site?

#1689795

Hi Nigel

Apologies but I've had you looking at the wrong table; the entries are in the options table and they are option names not meta keys. I've seen them on two sites.

Does this help?

#1691329

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

OK, I located similar options in the database for my own test sites.

I scanned the Types source code and I can see that these options are used for storing information about which columns to show in the post relationships UI on post edit screens.

So you will see these options on sites where you have set up post relationships, and not on sites that don't have relationships, and it is expected that there may be multiple entries with different number suffixes.

You can see the details in the file types/application/models/post_type/relationship_settings/relationship_settings.php where this is set up.

#1704675

Thanks for looking into that - good to know there won't be a stack of unnecessary entries in the database