Question: I have a WooCommerce Shop with 850+ products that needs editing. Without having to purchase an Extended/Pro Plugin to mass edit these products... I am trying to do this through phpMyAdmin.

The site is a little bit of "Add to Cart" and "Ask for Quote", so we're using the RFQ Toolkit Plugin, to handle this. The BIG issue is where I need to Edit All 850+ Products by hand... in the Advanced Tab for each Product. :(

WooCommerce stores Product information in both the wp\_posts and wp\_postmeta tables, where WooCommerce Products have "product" listed for the post\_type column. Products sold as "Ask for Quote" (because of the RFQ Tookit) have an entry in the wp\_postmeta table of [meta\_id, post\_id, meta\_key, meta\_value]... where the meta\_key is '\_gpls\_woo\_rfq\_rfq\_enable', and the meta\_value of 'yes'.

So, I'm trying to build an UPDATE query in English like this:

Search the wp\_posts table for each Item with post\_type 'product' and get the ID's (assuming it's the same as post\_id in the wp\_postmeta table).

Then, using those ID's, create an associated entry in wp\_postmeta of [new meta\_id, post\_id or ID, \_gpls\_woo\_rfq\_rfq\_enable, yes].

Does this EVEN make sense? If not, I apologize and will further my question with whatever information you need to reasonable answer this question. :)

Sincerely,
Dennis Lambing / Agent CD

Answer: 
I understand that you are looking for inserting a new row on the wp\_postmeta table (not updating an existing one) for each product, so maybe this is what you are looking for:

```
INSERT INTO wp_postmeta (
    post_id,
    meta_key,
    meta_value
)

SELECT
    ID,
    '_gpls_woo_rfq_rfq_enable',
    'yes'

FROM wp_posts

WHERE post_type = 'product'

```

This makes a new meta for each product with the meta key `_gpls_woo_rfq_rfq_enable` and the value `yes`
Much thanks to Fernando M. for your excellent answer! :)

YES, this was exactly what I needed. You are great! :)

```
INSERT INTO wp_postmeta (
    post_id,
    meta_key,
    meta_value
)

SELECT
    ID,
    '_gpls_woo_rfq_rfq_enable',
    'yes'

FROM wp_posts

WHERE post_type = 'product'

```