To add product, you need to add
- an entry in posts table, with
post_type="product"
,post_title="product_name"
,post_excerpt="product_description"
. This will give you the post ID.- with the post ID, you will be able to add meta datas in the
post_metas
table._product_type, _visibility, _price, _sale_price…. - use terms tables to add category related to the product
- with the post ID, you will be able to add meta datas in the
You can see all product metas (with get_post_meta() ) to learn more about all the needed one and their real names.
Ok, you want to do it with sql request, but you can also import products with a csv file or with the woocommerce Api, functions, class and dedicated method can make it easier to define the right sql request.
Hope it gives you some hints.
Related Posts:
- Why is my database import losing text widget data?
- How To Export/Import WordPress (MySQL) Database Properly Via Command-Line?
- What’s the database relationship between a post and its attachments
- Export WP database for import using WP-CLI on Vagrant Box
- Importing posts from old website to new conflicting post ID’s?
- When importing database, it shows error
- Is a direct or import approach safer for migration into WordPress?
- MySQL Syntax Error upon restoring database from backup [closed]
- Import live site to local setup without access to live site
- Error establishing a database connection; After importing DB & Theme
- WordPress database import: Row size too large
- Export / import WordPress database
- Merging two databases without borking it
- Importing CSV into database table not working?
- Import users from old WP site to new one
- Make an Items attribute searchable (taxonomy using existing attribute)
- Connection refused on locahost after importing database?
- What does wp_term_taxonomy.parent reference?
- Importing Direct to DB – GUID Question
- Best practice to import user base (subscribers) from one website to another?
- Importer fails to import every post
- Clear Terms from Taxonomy for Specific Post IDs?
- What is the purpose of the “term_id” column in the “wp_term_taxonomy” table?
- Is it good practice to import/export a blog to test a redesign?
- Featured image from custom to WordPress database
- I cannot change anything in my wordpress database from within wordpress?
- I broke database after reuploading local version – what exactly happened? Database error
- Importing Concrete5 content to WordPress
- What is this JavaScript “require”?
- How can I make updates to a site, on a development copy, but then move updates back without overriding live site’s evolving database?
- get_results using wpdb
- How can I make a WordPress database portable and url independent?
- wpdb->insert multiple record at once
- How to migrate a HTTPS WordPress installation to localhost?
- Why does get_term() require taxonomy? Are term_ids not unique?
- How to stop WordPress using utf8mb4_unicode_520_ci collation?
- How to monitor server for error establishing a database connection
- Default WordPress settings API data sanitization
- Fatal error: Call to undefined function dbDelta()
- Connect to remote database using Localhost install
- remove missing image attachments
- Transient RSS feeds in wp_options not removed automatically?
- How to ensure data consistency in WordPress
- wp_options table value
- Database location in WordPress
- WooCommerce with thousands of products – site is very slow – optimize db queries? [closed]
- How to intercept update_option() before it saves data?
- Change SQL get_results to search for posts with custom term in custom taxonomy
- wpdb query on custom table not working [closed]
- How to diagnose and keep in check encoding issues?
- Add search Value to wp_list_table pagination
- How to fix unchanged URLs in Database after running serialized search and replace script?
- wp_redirection_404 table has grown to 7GB
- phpMyAdmin displays error when importing database
- WordPress database error – Error in SQL syntax – I can’t identify any error?
- Multiple wp_options tables to share content across installs
- Merging two wp_posts tables while avoiding duplicates
- Is there a smart way to obtain a list of only some selected user meta data?
- Why does importing copies of the database dump and the document root make WordPress data inconsistent?
- Permit Login if table row exists
- How Yoast SEO plugin works with variable %%name%%?
- What would Repair and Optimize WordPress Database do?
- MS Access to manage WordPress Database
- Saving zero as meta value
- Query multiple tables at once?
- Transferring/Uploading Data from DB to WordPress
- how to encyrpt DB_PASSWORD in wp-config
- Choosing http or https during manual installation of WordPress and database
- Undo WooCommerce CSV import
- Delete all posts that do NOT have a specific tag
- How do you render posts from outside wordpress?
- Second ezSQL initialization for MSSQL
- Fetch a single row from a custom table for to a given ID
- Database create or redirect
- Database structure cheatsheet
- White Screen in Home Page
- How to escape percentage sign(%) in sql query with $wpdb->prepare?
- WordPress has been updated! Before we send you on your way, we have to update your database to the newest version
- Malware in old website – how to migrate?
- A WP dev site that displays content from a live site’s database but cannot write to wp_posts?
- error establishing database connection (WAMP + filezilla)
- Is there a way for two deferent themes to consume two different DB on a same WP instance?
- How do I update a WordPress wp_postmeta meta_value that contains many options
- How to display $wpdb->insert_id; value on redirected page
- Should I Use only wpdb Class to Write Custom Queries?
- Auto populate form fields based on serial input or pull listings from other websites?
- How to extract some part of WordPress full source code
- Error establishing a database connection for some files
- Hash user emails in database?
- Looking for suggestions on creating simple database (Help!!)
- Weird characters in title if it contain “ ”
- DB access blocked when initializing WP externally
- Saving data to database and exporting to excel
- Site does not work right, pages not showing up, even for root admin
- One information repeated on multiple locations on one site [closed]
- Showing Error(TAble already exist)
- How to properly configure SSL connection to remote azure database for running queries within a WordPress environment
- How do I load a sql.gz file to my database? (importing)
- Database Queries are crashing the server
- Uploading to WordPress Database