Skip to content

Instantly share code, notes, and snippets.

  • Save FrancoStino/0fa839441dc4a7946cf648ceaa423176 to your computer and use it in GitHub Desktop.
Save FrancoStino/0fa839441dc4a7946cf648ceaa423176 to your computer and use it in GitHub Desktop.
Query SQL per identificare gli shortcode contenenti l'id del prodotto nella breve descrizione di ogni prodotto e rimuoverli - Woocommerce
UPDATE wp154_posts
SET post_excerpt = REPLACE(post_excerpt,
SUBSTRING(post_excerpt,
LOCATE('[iw_product_price id=', post_excerpt),
LOCATE(']', post_excerpt, LOCATE('[iw_product_price id=', post_excerpt)) - LOCATE('[iw_product_price id=', post_excerpt) + 1
),
''
)
WHERE post_type = 'product' AND post_excerpt LIKE '%[iw_product_price id=%';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment