Figma Cleaner
Clean Figma Code from Post Content
by Abundant Designs · github.com/robertstaddon/figma-cleaner · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/robertstaddon/figma-cleaner/archive/refs/heads/main.zipWordPress plugin that finds Figma paste comments hidden in post, page, and Divi Theme Builder layout HTML and strips them from post_content.
Figma paste often injects comments like and into Divi text modules and other modules with an HTML text tab. In the Divi Builder they usually show up as empty sibling spans whose attributes hold HTML-encoded copies of those comments:
<span data-metadata="<!--(figmeta)…(/figmeta)-->"></span>
<span data-buffer="<!--(figma)…(/figma)-->"></span>
<span>Visible text</span>
Divi 5 stores the same comments inside JSON innerContent with unicode escapes (\u003c for <, \u002d for -, \u0026lt; for <). Wrapper spans are often stored as \u003cspan data-metadata=\u0022…\u0022\u003e rather than raw HTML. They are invisible on the Visual tab and on the front end, but they bloat the saved content. The cleaner removes the empty Figma spans and any leftover raw, HTML-encoded, or Divi 5 JSON unicode-escaped comment blocks. Visible text is kept.
Install
- Copy the
figma-cleanerfolder intowp-content/plugins/figma-cleaner/, or zip the folder and upload it under Plugins > Add New > Upload Plugin. - Activate Figma Cleaner.
- Disable or delete any Code Snippets “Run Once” Figma scan snippet so it does not take over the front end.
After this repo is pushed to main, child sites can install from GitHub without uploading a zip through wp-admin:
wp plugin install 'https://github.com/robertstaddon/figma-cleaner/raw/main/figma-cleaner.zip' --activate
The installable archive is figma-cleaner.zip in the repo root.
Use
- Go to Tools > Figma Cleaner (or click Settings on the Plugins screen).
- Review the list of matching posts, pages, and Divi Theme Builder layouts.
- Click Clean this page on one item, confirm, then check the page in Divi.
- Repeat, or use Remove Figma code from all listed items after you are confident.
- Purge any page cache for cleaned items.
Each cleanup saves a revision first, then removes Figma wrapper spans and HTML comments. Visible text such as <span>Week 3</span> is kept.
When finished
Deactivate and delete the plugin. It stores no settings.
Requires WordPress 6.0+ and PHP 7.4+.