Skip Navigation

[Resolved] Regarding custom fields import

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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

This topic contains 3 replies, has 2 voices.

Last updated by Mateus Getulio 1 year, 7 months ago.

Assisted by: Mateus Getulio.

Author
Posts
#2659163

We have created custom post type called "parts". There are around 240,000 parts in the database now.

We would like to add new custom field called "Stock", we added it using custom field and its okay.

The problem is how to add stock value to all existing 240,000 parts either through excel import or import into mysql directly. How shall we do it?

#2659253

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hey there,

Do you have the stock value for those parts already saved somewhere else that you want to import into WordPress, is that correct?

We have a few alternatives for you to import data:

Using CSV Importer :
https://toolset.com/course-lesson/import-content-csv-importer-plugin/

Using WP All Import:
https://toolset.com/course-lesson/import-posts-from-csv-with-relationships-using-wp-all-import/
https://toolset.com/course-lesson/how-to-import-data-from-a-csv-file-using-the-wp-all-import-toolset-types-add-on-plugin/

If you want to work with an SQL query instead, the following article will give you a full tour on Toolset DB schema:
https://toolset.com/documentation/programmer-reference/how-to-import-a-database-into-wordpress/

It's a complicated topic but those tutorials are really complete and thorough, they guide you step-by-step in exporting and importing content into your site developed with Toolset.

Please give it a try and tell us the results.

Best,

Mateus

#2659413

Thanks for the reply

Do you have the stock value for those parts already saved somewhere else that you want to import into WordPress, is that correct?
>> Yes, its in excel. Now we need to add stock value alone to existing 240000 parts. In the worst scenario, delete them all and import them again along with stock value. Any other better options?

#2659745

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

Thank you for your question. To import the stock information into your existing "parts" Custom Post Type (CPT) in WordPress, you can follow these comprehensive steps:

1. Plugin Installation:
Make sure you have the necessary plugins installed:
- WP All Import (freemium): This is the core plugin for handling imports.
- WP All Import - Toolset Add-on (premium): This add-on is essential for maintaining relationships created with Toolset. It allows you to link data between different post types.

2. Data Preparation:
- Organize your stock information in an Excel file. Ensure that the data is well-structured and that you have a unique identifier (e.g., post ID) for each "parts" entry. This identifier will be used to match and update the stock information accurately.

3. Accessing Import Screen:
- Go to your WordPress admin dashboard.
- Navigate to WP All Import's "Import CSV/XML" screen.

4. Configuring the Import:
- Select your Excel file containing the stock information.
- Configure the import settings, such as delimiter options, character encoding, and data format settings. Ensure that your settings match the structure of your Excel file.

5. Mapping Fields:
- On the "Fields & Taxonomies" step, map the stock data from your Excel file to the "stock" custom field in your "parts" CPT. You will need to use the unique identifier (e.g., post ID) to match each entry with its corresponding stock value. This ensures that the stock information is updated for the correct "parts" entries.

6. Maintaining Relationships:
- If your "parts" CPT has any relationships with other post types, you can use the Relationships section of the import screen. This is particularly useful for maintaining one-to-one, one-to-many, or many-to-many relationships between imported posts. You can drag and drop columns from your CSV file that represent post titles, slugs, or IDs to connect posts correctly.

7. Starting the Import:
- After configuring all the necessary settings and mappings, proceed with the import by clicking the "Run Importer" button.

By following these steps, you should be able to add stock values to your existing 240,000 "parts" entries without the need to delete or re-import them. WP All Import is designed to handle updates efficiently, ensuring that your stock information is accurately incorporated.

Should you encounter any issues or require further assistance during the process, please don't hesitate to reach out. We're here to help.

Best regards,
Mateus