Content Processing

Content Processing controls how Wash transforms WordPress content before syncing to Shopify. This includes URL rewriting, custom HTML tags, and content sanitization.

How Content Processing Works

WordPress Post Content
        ↓
HTML Parsing & Sanitization
        ↓
URL Rewriting (images, links)
        ↓
Custom HTML Tag Processing
        ↓
Gutenberg Block Conversion
        ↓
Shopify Article Body

URL Rewriting

Wash automatically rewrites URLs in your content to work correctly on Shopify.

What Gets Rewritten

URL TypeBeforeAfter
Imagesyourblog.com/wp-content/uploads/image.jpgcdn.shopify.com/s/files/.../image.jpg
Internal linksyourblog.com/post-name/yourstore.com/blogs/news/post-name
Category linksyourblog.com/category/news/yourstore.com/blogs/news
Author linksyourblog.com/author/john/Removed or preserved (configurable)

URL Rewriting Settings

SettingDescriptionDefault
Rewrite internal linksConvert WordPress URLs to Shopify URLsOn
Rewrite image URLsPoint images to Shopify CDNOn
Preserve external linksKeep links to other domains unchangedOn
Add nofollow to externalAdd rel="nofollow" to external linksOff
Open external in new tabAdd target="_blank" to external linksOff

Link Mapping Rules

You can create custom link mapping rules:

{
  "patterns": [
    {
      "from": "/category/news/",
      "to": "/blogs/news"
    },
    {
      "from": "/tag/([^/]+)/",
      "to": "/blogs/news/tagged/$1"
    },
    {
      "from": "/author/([^/]+)/",
      "to": null
    }
  ]
}

Custom HTML Tags

Shopify's article body field has limitations on which HTML tags are allowed. Wash can transform custom tags.

Allowed Tags in Shopify

Shopify allows these HTML tags in article content:

a, abbr, acronym, address, b, blockquote, br, cite, code,
dd, del, dfn, div, dl, dt, em, h1-h6, hr, i, img, ins, kbd,
li, ol, p, pre, q, s, samp, small, span, strike, strong,
sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, var

Tag Transformation

WordPress TagShopify EquivalentNotes
<figure><div class="figure">Wraps images with captions
<figcaption><p class="caption">Image caption text
<article><div class="article">Semantic wrapper
<section><div class="section">Content section
<aside><div class="aside">Sidebar content
<nav><div class="nav">Navigation element
<header><div class="header">Header element
<footer><div class="footer">Footer element
<main><div class="main">Main content
<iframe>Removed or placeholderNot allowed in Shopify
<script>RemovedSecurity: never synced
<style>RemovedUse theme styles instead

Custom Tag Rules

Define your own tag transformation rules:

  1. Go to Wash > Settings > Content Processing
  2. Find Custom Tag Rules section
  3. Add rules in JSON format
{
  "rules": [
    {
      "tag": "custom-cta",
      "replace_with": "div",
      "add_class": "cta-box"
    },
    {
      "tag": "warning-box",
      "replace_with": "div",
      "add_class": "alert alert-warning"
    },
    {
      "tag": "video-embed",
      "action": "remove"
    }
  ]
}

Content Sanitization

Security Filtering

Wash automatically removes potentially dangerous content:

  • Scripts — All <script> tags removed
  • Event handlersonclick, onload, etc. removed
  • JavaScript URLsjavascript: links converted to #
  • Data URLs — Large data URLs in images removed
  • Iframes — Removed unless from allowlisted domains

Iframe Allowlist

Some iframes can be preserved if from trusted sources:

SourceAllowedNotes
YouTubeYesyoutube.com, youtube-nocookie.com
VimeoYesvimeo.com, player.vimeo.com
SpotifyYesopen.spotify.com
SoundCloudYessoundcloud.com
Google MapsConfigurableEnable in settings
Custom domainsConfigurableAdd to allowlist

Note: Even allowlisted iframes may not render in Shopify article content. Consider using metafields for embedded content.

Shortcode Handling

WordPress shortcodes are processed before sync:

Shortcode Options

OptionDescription
Render shortcodesExecute shortcodes and sync rendered HTML
Remove shortcodesStrip shortcode tags, keep inner content
Preserve as textKeep shortcode syntax as plain text

Common Shortcode Handling

[gallery]        → Rendered as image grid
[caption]        → Converted to figure/figcaption
[video]          → Placeholder or metafield reference
[audio]          → Placeholder or metafield reference
[embed]          → Processed based on embed type
[custom_shortcode] → Rendered or stripped (configurable)

Whitespace & Formatting

Whitespace Options

SettingDescriptionDefault
Minify HTMLRemove unnecessary whitespaceOff
Preserve line breaksConvert \n to <br>On
Remove empty paragraphsStrip <p></p> tagsOn
Fix double spacingConvert multiple spaces to singleOn

Configuration

Accessing Settings

In WordPress:
  1. Go to Wash > Settings
  2. Select Content Processing tab
  3. Configure options and save
In Shopify App:
  1. Go to Apps > Wash > Connections
  2. Select your connection
  3. Navigate to Settings > Content

Troubleshooting

Content Not Rendering Correctly

  • Check if tags are being transformed as expected
  • Review custom tag rules for conflicts
  • Verify Shopify theme supports the CSS classes
  • Check for unclosed HTML tags in source

Links Pointing to Wrong URLs

  • Verify URL rewriting is enabled
  • Check link mapping rules
  • Ensure blog mappings match link patterns
  • Review smart redirections for old URLs

Images Not Loading

  • Verify image sync is enabled
  • Check if image URL rewriting is on
  • Confirm images were uploaded to Shopify
  • Review image size limits

Embeds Not Working

  • Iframes are restricted in Shopify articles
  • Use metafields for video embeds
  • Consider using Shopify's native video handling
  • Check iframe allowlist settings

Related Documentation