k-sync
Back to blog

Cleaning up WooCommerce shortcodes in product descriptions for Shopify (2026)

How to identify and remove WooCommerce shortcodes, plugin-specific HTML, and WordPress template tags that break product descriptions when migrated to Shopify.

·By k-sync
5 min read · 1,071 words

WooCommerce product descriptions frequently contain WordPress shortcodes — placeholders like [su_button], [vc_row], or [product_page] — inserted by page builder plugins or WooCommerce extensions. When exported and imported into Shopify, these shortcodes render as visible raw text on product pages, looking like: [product_page id="123"]. This guide covers how to identify, clean, and replace all shortcode content before migrating to Shopify.

Common WooCommerce shortcodes found in product descriptions

Page builder shortcodes (render as broken text on Shopify)

Plugin shortcodes

WordPress/WooCommerce native shortcodes

Finding shortcodes in your WooCommerce database

Method 1: MySQL direct query (most comprehensive)

-- Find all products with shortcodes in description or short_description
SELECT ID, post_title, post_content, post_excerpt
FROM wp_posts
WHERE post_type = 'product'
AND post_status = 'publish'
AND (
  post_content LIKE '%[%]%'
  OR post_excerpt LIKE '%[%]%'
);

This finds any post content containing brackets — export results to review which shortcodes are present.

Method 2: WooCommerce export + text analysis

  1. Export products to CSV via WooCommerce Admin → Products → Export
  2. Open CSV in Excel or Google Sheets
  3. Use FIND to search for "[" in Description and Short Description columns
  4. Or: use a text editor with regex — search for [[a-zA-Z_]+[^]]*] to match shortcode patterns

Method 3: WordPress CLI (WP-CLI)

wp post list --post_type=product --fields=ID,post_title,post_content   --post_status=publish --format=csv | grep "["

Bulk shortcode removal strategies

Option 1: SQL find-and-replace (direct DB)

-- Remove WPBakery shortcodes from product descriptions
-- WARNING: Always backup your database before running SQL updates

UPDATE wp_posts
SET post_content = REGEXP_REPLACE(
  post_content,
  '\[vc_[^\]]*\]',
  ''
)
WHERE post_type = 'product';

-- Repeat for other shortcode patterns

Option 2: Better Search Replace plugin (WordPress admin)

Option 3: Custom PHP script (recommended for large catalogs)

<?php
// run-cleanup.php — run once, delete after
require 'wp-load.php';

$products = get_posts(['post_type' => 'product', 'posts_per_page' => -1]);

foreach ($products as $product) {
  $clean_content = $product->post_content;

  // Strip WPBakery shortcodes
  $clean_content = preg_replace('/\[vc_[^\]]*\]/', '', $clean_content);
  $clean_content = preg_replace('/\[\/vc_[^\]]*\]/', '', $clean_content);

  // Strip Shortcodes Ultimate
  $clean_content = preg_replace('/\[su_[^\]]*\]/', '', $clean_content);
  $clean_content = preg_replace('/\[\/su_[^\]]*\]/', '', $clean_content);

  // Strip WooCommerce embeds
  $clean_content = preg_replace('/\[wc_[^\]]*\]/', '', $clean_content);

  if ($clean_content !== $product->post_content) {
    wp_update_post(['ID' => $product->ID, 'post_content' => $clean_content]);
    echo "Cleaned: " . $product->post_title . "
";
  }
}
echo "Done.";
?>

Replacing shortcodes with Shopify-compatible HTML

Simply removing shortcodes loses content. For shortcodes that generate real content, replace with static HTML:

Accordion / tabs (su_accordion → HTML details/summary)

<!-- WooCommerce: [su_accordion][su_spoiler title="Features"] Content [/su_spoiler][/su_accordion] -->

<!-- Shopify-compatible replacement: -->
<details>
  <summary>Features</summary>
  <p>Content</p>
</details>

Tables (TablePress → HTML table)

<!-- WooCommerce: [tablepress id="3"] -->
<!-- Export table from TablePress → export to HTML table → paste static HTML into Shopify description -->
<table>
  <thead><tr><th>Column 1</th><th>Column 2</th></tr></thead>
  <tbody><tr><td>Value</td><td>Value</td></tr></tbody>
</table>

YouTube videos (video shortcodes → iframe)

<!-- WooCommerce: [youtube id="VIDEOID"] -->
<!-- Replace with: -->
<iframe
  src="https://www.youtube.com/embed/VIDEOID"
  width="560"
  height="315"
  allowfullscreen>
</iframe>

PDF embed (pdf-embedder → Google Docs viewer link)

<!-- WooCommerce: [pdf-embedder url="https://...file.pdf"] -->
<!-- Shopify: use a plain link or Google Docs viewer -->
<a href="https://yourcdn.com/file.pdf" target="_blank">Download PDF (opens in new tab)</a>

WPBakery / Divi content in product descriptions

Products edited in WPBakery or Divi store their content as a mix of shortcodes and raw HTML. After removing the shortcode wrappers, you're left with the actual text content. However, the layout (columns, sections) is lost — you need to rebuild the content as clean HTML:

  1. View each affected product page on WooCommerce before migration and screenshot the rendered layout
  2. Use screenshots as reference to rebuild the content as clean HTML
  3. Alternatively: use Divi/WPBakery export to generate a rendered HTML snapshot of the content
  4. For large catalogs: prioritize top-selling products (top 20% by revenue) for manual content review; bulk-strip the rest

HTML sanitization: other artifacts to clean

Beyond shortcodes, WooCommerce product exports commonly contain:

Shortcode cleanup checklist

The shortcode cleanup step is tedious but essential — visible raw shortcode text on product pages is unprofessional and damages conversion rate immediately. The discovery phase (finding all affected products) is usually quick. The actual cleanup scales with how extensively page builders were used. A store with 500 simple products where only 10% used Shortcodes Ultimate for accordion tabs is a half-day cleanup. A store where every product description was built in Divi may require a full week of content migration work.

Migrate your store with k-sync

Connect your WooCommerce store, validate your products, and push to Shopify in minutes. Free for up to 50 products.

Get started free

Related reading

Browse all migration guides