Fanus van Straten
Fanus van Straten

Reputation: 33

Copy WooCommerce Product Short Description to Product Long Descrition in database

I have a client site that has about 800 WooComm products.

All the single product description text content has been captured in the "Product Short Description" area and not in the "Product Long Description" area of a single product page.

I need to bulk copy the content from "Product Short Description" to "Product Long Description".

...and possibly bulk delete the "Product Short Description" afterwards.

Maybe I can do this in the database via PHPMyAdmin?

Any ideas?

Upvotes: 3

Views: 4760

Answers (1)

LoicTheAztec
LoicTheAztec

Reputation: 253859

Try this simple SQL query that will copy Product Short Description to Product Long Description:

UPDATE `wp_posts`
SET `post_content` = `post_excerpt`
WHERE `post_type` = 'product'
AND `post_status` = 'publish'

Always make a database backup before (in particular wp_posts table).

Tested and works


Once done you it's better and more secure to empty the short description afterwards with:

UPDATE `wp_posts`
SET `post_excerpt` = ''
WHERE `post_type` = 'product'
AND `post_status` = 'publish'

Tested and works


If it doesn't work for you, check that your tables prefix should all start with wp_ … If not, replace wp_ by your specific prefix.

Upvotes: 8

Related Questions