V
V
veteral2021-09-27 13:10:39
WordPress
veteral, 2021-09-27 13:10:39

What wordpress tables are used to store products in the database?

Hello!
I want to make an automatic record of goods in the database. Can someone tell me what tables to write down. The product itself, I see, is recorded in wp_posts. Where are attributes, upsells, tags, categories stored?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Zolin, 2021-09-28
@artzolin

I don’t know about the description of the tables, but, in general, from their names it’s already quite clear which ones are responsible for what

  • wp_options - site and theme settings
  • wp_users - users
  • wp_usermeta - user meta fields
  • wp_comments - comments
  • wp_commentmeta - comment metafields
  • wp_posts - posts
  • wp_postmeta - post meta fields
  • wp_terms - terms
  • wp_termmeta - term metafields
  • wp_term_taxonomy - taxonomies
  • wp_term_relationships - Term relationships with taxonomies

When creating your entries in the database, you need to at least use native functions, so you will avoid many problems
  • wp_insert_post()- create an entry
  • wp_update_post()- update record
  • add_post_meta()— add a value with a meta field
  • update_post_meta()- update value with meta field
  • wp_set_object_terms()- set taxonomy for post

These are the basic functions of the core, when publishing products it is better to look for and use the methods of WooCommers itself

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question