Skip Navigation

[Resolved] 27,000 term meta fields as individual records in wp_options, safe to delete?

This support ticket is created 3 years 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/Karachi (GMT+05:00)

This topic contains 3 replies, has 3 voices.

Last updated by Waqar 3 years ago.

Assisted by: Waqar.

Author
Posts
#2271093
Screen Shot 2022-01-20 at 1.23.06 AM.png

I have a site with around 50k custom posts and a few thousand taxonomies, those taxonomy pages are for Cities and states, and I have added custom term meta with toolset to them. Noticing now that my wp_options table in the database is full of a /ton/ of the term meta data. Did it get stuck along the way and ended up here? The site itself works wonderfully, but I feel like this data is stored somewhere else?

Can I clear these rows out or is this actually the way toolset stores this data?

Tell us what you are trying to do?
Clean up my WP database

Is there any documentation that you are following?
None available

Is there a similar example that we can see?

#2271273

Nigel
Supporter

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

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

Hi Nicholas

I don't recognise those entries.

Yes, wpcf- is a prefix used for Toolset custom fields, but your option entries begin with state_..., and I don't recognise that format. (I understand that they are coming from a taxonomy for states.)

When you add custom fields to custom taxonomies, the data itself is stored in standard WordPress tables.

So the definition about the term field is stored in wp_options.

The custom field values for individual terms themselves are stored in wp_termmeta.

So, on my local test site I have a "colour" taxonomy, to which I added a custom field "hex-value".

So there is one entry in wp_options which has an array with the custom field settings data.

And then for each term (e.g. "red") there is an entry in wp_termmeta for the field value (e.g. "#ff0000").

So for the hex-value field there will be lots of entries in wp_termmeta (one for each term where a value is assigned), but only one entry in wp_options.

There appear to be lots of entries in wp_options in your case for the same term field that store content (html headings) rather than settings, which doesn't look right.

All I can suggest is that you take a backup of your database, then delete these "redundant" entries in wp_options, then test that everything still works as expected. If not, you can roll back.

#2271627

I made a full backup *twice* and then deleted them all, not sure why they got out of wp_termmeta and ended up as their own entries.. maybe it was an issue with WPAll Import/Export that broke and didn't care to clean up.

Deleted them all and the site and all pages are still 100%, feels good knowing all this excess is out of the database!

Thanks

#2271893

Thanks for the update and glad that everything is working fine.

You're welcome to mark this ticket as resolved and start a new one, for each new question or concern.