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_metastable._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
- Safest way to bulk delete post revisions
- Please explain how WordPress works with MySQL character set and collation at a low level
- How many users can WordPress handle?
- Automate WordPress Database Upgrade
- WordPress database scalability from the code perspective
- WordPress Unit Testing – Cannot Create Tables
- Where are image paths to product category images stored in WordPress database
- How are terms connected with posts in database?
- Remove old custom field after import
- how do I determine which image is the featured image in the database
- Prevent changing the length of post_name column on WordPress Update
- Why does dbDelta() not catch MysqlErrors?
- how to transfer wordpress sql/database from local to live
- Is altering a default WordPress database table update safe?
- Get Database Credentials from within the themes file
- what to do when your WordPress database is too large?
- Change all http to https in mysql databse?
- WordPress DB: options-table –> 32 gzipcompression?
- Having issues with wp_postmeta and wp_usermeta tables too big
- WordPress site uses MyISAM, should I switch to InnoDB necessary?
- How to prevent WordPress from retrieving data for the last 10 posts in the database?
- WP Database Table to CSV file
- Uppercase to sentence case for post titles
- How to retrieve and show database table in wordpress dashboard
- Moving to another host; which tables to move in a database
- Merge two WordPress installations into one, and keep posts separated?
- Moving online website to MAMP or dumb idea?
- How can I transition a site from using the Beta Tester plugin to a “normal” install?
- Storing data for a wordpress plugin
- Advanced SELECT query with condtional statements
- How can I (semi) automate a database export and import to a different location?
- Insert post in another database
- Improve performance by removing unnecessary database queries
- Redirecting to old domain after migration website
- Localhost keeps redirecting to live domain
- Child parent relationship inside WP DB
- Copying database tables to new database
- Organize WordPress site, so it can maintain with huge database
- “Error establishing a database connection” – Intermittent error on GoDaddy
- WordPress site to be able to connect with data on local machine of user
- Bulk Updating Post Date in 1 day Increments
- Trying to create a custom meta table for working with a custom table
- Debugging – logging database queries
- How to connect and insert data in database of wordpress?
- wp_option table error while importing
- What is wrong here? Issue with post_id and meta_value
- Counting post and changing roles in mysql database. Query not code
- Deleting empty meta key values
- Bulk Edit Media Library alt, caption, image names
- WP 5.5, child themes, customizer and a weird cache issue
- Best way to store 1 billion+ posts?
- Why am I being prompted to reinstall wordpress?
- What’s the easiest way to connect external database and display data on wordpress?
- Character encoding issue – black diamond question marks on imported post excerpts
- After renaming MySQL database, I can no longer access my Blog page
- Reinstall wordpress/mySQL caused database problem
- Call to a member function insert()
- Create a new table on the database and save parameters from a contact form
- How to have WP Search widget index dynamically generated content?
- Preventing concurrent update of data
- How to add data from wordpress tables to new database tables you have created
- Category not displaying in add post, edit post, and categories page.
- Creating Tables in WordPress Database
- Calling update_user_meta inside of another function doesn’t work
- $wpdb->prepare returns empty array
- Prevent creation of unused database tables?
- How to store a plain password in WordPress database in another field
- wp-config was suddenly updated
- Order of search results based off of a backend custom field and also in alpha order
- How to find fresh (last modified) and sql backup?
- Find specific text in the database and display the context of where that text is
- SEO impact: WP+Next.js hybrid [closed]