Publish Helper logo

將 Google Docs 轉換為乾淨 HTML

Google Docs 是最受歡迎的協作寫作工具,但其複製貼上的 HTML 以inline styles、空的 span wrapper和專有 CSS class 而聞名。Publish Helper 可移除所有 Google Docs 殘留標記,將帶有樣式的標記轉換為乾淨的semantic HTML,適用於任何 CMS。

I為什麼 Google Docs 的 HTML 這麼亂

Google Docs 會將每段文字包裝在涵蓋 font-size、font-family、color 和 font-weight 的 inline styles 屬性中。它會添加像 c1、c3 和 c8 這樣的專有 CSS class 到段落和 span 上。粗體文字使用 style="font-weight:700" 而非 semantic 的 <strong> 標籤。空的 <span> 元素被插入作為格式錨點,列表項目則帶有深層嵌套的wrapper div。

II清理前後對比

Google Docs 輸出

<p class="c3"><span style="font-size:12pt;font-family:Arial;color:#000000;font-weight:700">Introduction</span></p>
<p class="c3 c8"><span style="font-size:11pt;font-family:Arial;color:#000000">This is a paragraph with </span><span style="font-size:11pt;font-family:Arial;color:#000000;font-weight:700">bold text</span><span style="font-size:11pt;font-family:Arial;color:#000000"> and </span><span style="font-size:11pt;font-family:Arial;color:#000000;font-style:italic">italic text</span><span style="font-size:11pt;font-family:Arial;color:#000000">.</span></p>

乾淨的 HTML

<h2>Introduction</h2>
<p>This is a paragraph with <strong>bold text</strong> and <em>italic text</em>.</p>
III如何清理 Google Docs 的 HTML

1.從 Google Docs 複製您的內容

2.貼到 Publish Helper 中並設定清理選項

3.點擊清理 HTML 並複製結果

IV常見問題

為什麼 Google Docs 的 HTML 有這麼多inline styles?

+

Google Docs 產生的 HTML 會保留其編輯器中精確的視覺格式。每段文字都會被賦予明確的 font-size、font-family、color 和 font-weight 屬性,以便在貼上到其他地方時看起來完全一致。這意味著即使是純黑色文字也會帶有冗餘的樣式宣告。

可以直接將 Google Docs 貼到 WordPress 嗎?

+

可以,但 WordPress 會繼承所有的 inline styles 和專有 class,導致格式不一致。建議先使用 Publish Helper 移除 Google Docs 的殘留標記,然後再將乾淨的 HTML 貼到 WordPress 的程式碼編輯器或自訂 HTML 區塊中。

Publish Helper 能處理 Google Docs 的表格嗎?

+

可以。Publish Helper 會保留表格結構(列、儲存格、標題),同時移除表格元素上的 inline styles 和 Google Docs 特定的屬性。

Related Tools & Guides

Ready to clean your HTML?

Open Publish Helper

Last updated: March 2026

更新日誌

v2.2.02026-03-18
  • 新功能AI-Powered Title to SEO Slug — Convert blog titles in any language to SEO-friendly English slugs in under 10 seconds
  • 新功能Slug generator toggle on the main page — generate slugs right after editing, above the fold
  • 新功能Table support — pasted tables from Google Docs now render correctly
  • 新功能Remove <br> after headings cleanup option (on by default)
  • 新功能Partial text selection copy in the HTML code view
  • 新功能Sticky Clean HTML button at the bottom of the page
  • 改進Heading conversion now strips prefixes from existing heading tags and supports Chinese full-width colon (:)
  • 改進Shared footer across all pages
v2.1.22026-03-17
  • 修復Bug fixes and improvements
v2.1.12026-03-16
  • 修復Bug fixes and improvements
v2.1.02026-03-16
  • 新功能Formatted/Raw toggle for the HTML code view
  • 改進Copying from the code panel now always gives clean, unformatted HTML
v2.0.02026-03-16
  • 新功能Welcome to Publish Helper — free online tools for content editors
  • 改進Improved search engine visibility
v1.1.02026-03-16
  • 改進Clipboard copy — clean HTML output matches the code view
v1.0.02026-03-16
  • 新功能Rich text editor with Google Docs paste support
  • 新功能HTML cleanup: strip styles, classes, empty tags, and Google Docs artifacts
  • 新功能Heading conversion from text prefixes to proper HTML tags
  • 新功能Find & replace with regex support and saveable presets
  • 新功能Syntax-highlighted HTML preview with one-click copy