Skip Navigation

[Resolved] Multiple ToolSet WooCommerce Custom Fields Were Auto-Created And Can't Edit

This support ticket is created 2 years, 1 month 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.

This topic contains 9 replies, has 3 voices.

Last updated by garikH 2 years, 1 month ago.

Assisted by: Christopher Amirian.

Author
Posts
#2284017
Screen Shot 2022-02-04 at 2.19.47 PM.png
Screen Shot 2022-02-04 at 2.19.32 PM.png

I am trying to:
As you can see in the screenshots, multiple "ToolSet WooCommerce" custom fields were created and I can't edit or delete them. Any idea why this happened?

Link to a page where the issue can be seen:
They can be found in WordPress under Toolset--> Custom Fields
Or alternatively by editing any of the product pages

I expected to see:
None of these fields.

Instead, I got:
Screenshots.

#2285087

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

Would you please create a staging version of your website and share the login information by checking the next reply as private?

Please do not include the live website info as we will need to test by deactivating third party plugins and themes to check why the issue is happening for you.

#2285161
#2285699

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

Thank you for the login information. We are going to check and see if we have a clue and get back to you.

#2286539

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

The issue seems to be happening either because of a conflict with a third-party Woocomemrce plugin or a custom code that you might have on your website.

The issue happens when you check a product listing in the admin and it generates the issue. Please follow the steps below after making sure that you have a complete backup of the website to remove those extra items:

https://toolset.com/forums/topic/toolset-woocommerce-starts-multiplying-custom-fields-in-back-end/#post-2092581

To find which plugin is causing the issue you need to deactivate the third party Woocommerce related plugins and remove the custom code if you have.

Then, try to enable them one by one and check the product listing page and see if the problem happens. That way you will find the cause of the conflict.

Thanks.

#2288823

Hey Christopher,

Thanks for the detailed next steps. I tried disabling and re-enabling plugins but was unable to replicate the issue. The # of auto-generated "Toolset Woocommerce" fields is exactly 23 and I was unable to change this (there was no increase as I went through the steps). It doesn't appear to be generating more than 23 of those fields for some reason.

Regarding the next step, your code worked but a little too well—it cleared out the duplicate fields but also deleted my custom Toolset field "Field Group for Ethical Brands" which I need. How can I work around this so I don't lose that field in the process?

#2289787

Nigel
Supporter

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

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

Hi Garik

Let me step in here while Christopher is off today.

Firstly, sorry about that code snippet for deleting the surplus field groups, it contains a typo and should read like so:

$wcfgs = get_posts( array(
    'post_type' => 'wp-types-group',
    'title' => 'Toolset WooCommerce',
    'numberposts' => 25
));

foreach ($wcfgs as $key => $wcfg) {
    wp_delete_post( $wcfg->ID, true );
}

The staging site you created for Christopher no longer seems to be available, so I took a copy of your site to do some testing locally. I used the ammended snippet there, and it successfully eliminates the surplus field groups, and no others.

I haven't been able to identify what causes the extra groups to be created, however.

I know why they are created, but not what triggers it.

Specifically, we run a query to check whether the field group exists or not, and if not we create it.

The problem with the previous client was that they had a custom plugin which indiscriminately modified queries on the product and order listing pages that affected our query and meant it always found zero existing field group posts, prompting us to create one.

Something similar must be happening on your site, but I'm not sure what the trigger is. I've tried to isolate a plugin that may cause the problem on the same back end pages, but no extra field groups are being created.

All I can suggest is that you keep an eye on this when navigating your site, and periodically check whether the additional field groups are generated, to see if you can spot the action required to trigger their creation. If you find something let us know, we may be able to find the cause within the corresponding code.

As an aside, I thought you may want to do some house-keeping on your site. The package created was extremely large, and checking the installation locally, I see that you have one very large database table in particular, relating to one of your plugins. I'd double-check whether it is really needed.

I'll keep a copy of your site locally so that if you find an action that triggers the problem I can try to reproduce it.

#2289865

Hey Nigel,

Thanks for the code—worked perfectly!

I'm pretty stumped on what's triggering it as well. My hunch was that it has something to do with the Datafeedr plugins (of which there is 3 plus My Custom Code) and those plugins add and delete products, etc. but interestingly enough a duplicate custom field "Field Group for Ethical Brands" was also created. It's just one field and I can delete manually, so not a big deal, but all this to say I'll keep monitoring and unsure at this point what's going on. No new "Toolset Woocommerce" fields since deleting them.

I did delete the staging site so I could recreate another one and try some different things. Happy to share again if you need it.

Lastly, regarding your feedback on the very large database table—thank you, that's very much appreciated! Can you provide more details on this, I definitely want to look into it and fix if possible.

#2291025

Christopher Amirian
Supporter

Languages: English (English )

Hi There,

I am glad that you have managed to delete the extra fields and thank you for keeping an eye on this so you can pinpoint the cause of the issue to share with us.

I will ask Nigel tomorrow for more information about the large database table and get back to you.

Meanwhile, I would consider hiring a developer to do such cleanups as it is a sensitive thing to do, you know, to make sure no data will be lost.

You are welcome to check some contractors here:

https://toolset.com/contractors/

Thanks.

#2291753

Nigel
Supporter

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

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

Hi Garik

You can see the size of the database tables using phpMyAdmin. If you don't have access to phpMyAdmin you could use a plugin which lets you inspect the database and perform basic operations.

I'd recommend WP Data Tables: you can use the Data Explorer to see the tables with their sizes, and perform operations such as DROPping the table.

I don't recall the table name, but when you find the very large table, you can hopefully identify which plugin is responsible for creating the table, to be able to make a decision about whether the table can be dropped or whether the data needs to be retained.

#2297069

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.