Skip Navigation

[Resolved] Copy Custom Field Contents (all records) to Another Custom Field

This support ticket is created 2 years, 3 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 6 replies, has 2 voices.

Last updated by Minesh 2 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#2658349

Hi,

I have a custom field that is holding a Wistia video URL. It doesn't seem to be the correct field format, and I cannot change the format. So I've created a second custom field. What is the best way to copy the contents of one custom field into another for all records of a custom post type?

It's basically an Excel column copy and paste, but obviously doesn't work like that given the WP database structure. Is there a SQL command I can run?

I'd want to copy the contents of wpcf-video-url -> wpcf-video-embed for all records with custom post type 'property'

Thanks in advance

#2658429

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

There is no such feature available.

However - Here is the link that shows how you can update such post meta key for your post type. You may update the query as required and please do not forget to take full backup of your database.
- https://wordpress.stackexchange.com/questions/226436/sql-query-to-copy-value-of-a-meta-key-into-another-meta-key

#2659461

I have maybe 2500 custom posts with custom fields, all created with Toolset.

I need to either:

1. change the field type

OR

2. copy the contents of one field to another field for each record.

Are you telling me there is no way to do this either using Toolset or in another way that you will support?

#2659483

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

1. change the field type
==>
Why you think the field type is not correct? You can change the field type when you edit your custom field group where your custom field is added and it will allow you to convert to another field type where allowed otherwise other field types that is not allowed will not be selectable.

Have you tried to edit your custom field group and locate your field within your custom field group and then try to change the field type to your desired field type. Does that helps?

#2659485

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

In addition to that I found a related ticket that might help you as well to copy one field content to another - before running any script I suggest you must take full backup of your database.
- https://toolset.com/forums/topic/converting-mulitline-to-wysiwyg-again/#post-2285517

#2659487

Thank you for pushing me to buy ACF and completely rebuild my website without Toolset

#2659491

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I'm not sure if you able to see my reply where the possible workaround is to use custom shortcode to copy one field value to another:
=> https://toolset.com/forums/topic/copy-custom-field-contents-all-records-to-another-custom-field/#post-2659485

I'm afraid there is no other automatic way or feature supported by Toolset that copy the one custom field value to another automatically.