Title: HTML代码优化工具
Author: wbolt.com
Published: <strong>4 июля, 2019</strong>
Last modified: 1 июня, 2022

---

Search plugins

![](https://ps.w.org/clear-html-tags/assets/banner-772x250.png?rev=2117298)

This plugin **hasn’t been tested with the latest 3 major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://ps.w.org/clear-html-tags/assets/icon-256x256.png?rev=2117298)

# HTML代码优化工具

 By [wbolt.com](https://profiles.wordpress.org/wbolt/)

[Download](https://downloads.wordpress.org/plugin/clear-html-tags.1.1.2.zip)

 * [Details](https://kk.wordpress.org/plugins/clear-html-tags/#description)
 * [Reviews](https://kk.wordpress.org/plugins/clear-html-tags/#reviews)
 *  [Installation](https://kk.wordpress.org/plugins/clear-html-tags/#installation)
 * [Development](https://kk.wordpress.org/plugins/clear-html-tags/#developers)

 [Support](https://wordpress.org/support/plugin/clear-html-tags/)

## Description

> **Magicpost插件**
> 由于产品线调整，HTML代码优化工具（后续不再更新版本）已整合到Magicpost插件，该插
> 件将包括定时发布、文章搬家、HTML清理、下载管理和社交分享等模块。！ [了解详情](https://www.wbolt.com/plugins/magicpost?utm_source=wp&utm_medium=link&utm_campaign=magicpost)

HTML代码优化工具（Clear HTML Tags）是一款站长实用的WordPress文章编辑辅助插件，可以
帮助站长快速实现删除HTML代码不需要的常见HTML标签及标签属性，常用的代码格式优化。

### 1.支持删除超过40种的代码标签且支持自定义设置。

支持删除的HTML代码标签包括：
 * **常见标签**-a/div/span/article/figcaption/figure/
br/section/blockquote/em/b/i/strong/h1/h2/h3/h4/h5/h6/p/img/video。 * **表格标签**-
table/tbody/thead/tfoot/td/th/tr/col/caption/colgroup。 * **列表标签**-ul/li/ol/
dl/dt/dd。 * **其他标签**-detail/header/footer/hr/iframe/ins/body/head/html/ruby/
title/script/nav。

### 2.支持删除超过10种的代码标签属性且支持自定义设置。

支持删除的常见HTML代码标签属性包括：id/class/style/srcset/sizes/width/height/data-*/
rel/alt等.

### 3.支持代码格式优化。

支持段落开头空格删除，段落之间自动空行，图像之间自动空行，图像与段落间自动空行，
H标题与段落间自动空行。

全新的版本在用户体验上进行了优化，由原来的文章编辑操作时设置插件参数改为插件设置
界面设置默认参数，文章编辑时可临时调整当前操作参数，提升插件的工作效率。

### Notes

[HTML代码优化工具](https://www.wbolt.com/plugins/cht?utm_source=wp&utm_medium=link&utm_campaign=cht)
是一款简单实用的WordPress文章编辑辅助插件，可以帮助站长将文章HTML代码中不需要的代码
标签及属性一键删除。目前支持清理的HTML代码标签30+种，常见标签属性8种。

闪电博（[wbolt.com](https://www.wbolt.com/?utm_source=wp&utm_medium=link&utm_campaign=cht)）
专注于WordPress主题和插件开发,为中文博客提供更多优质和符合国内需求的主题和插件。
此外我们也会分享WordPress相关技巧和教程。

除了HTML代码优化工具插件外，目前我们还开发了以下WordPress插件：

 * [百度搜索推送管理-历史下载安装数120,000+](https://wordpress.org/plugins/baidu-submit-link/)
 * [热门关键词推荐插件-最佳关键词布局插件](https://wordpress.org/plugins/smart-keywords-tool/)
 * [Smart SEO Tool-高效便捷的WP搜索引擎优化插件](https://wordpress.org/plugins/smart-seo-tool/)
 * [博客社交分享组件-打赏/点赞/微海报/社交分享四合一](https://wordpress.org/plugins/donate-with-qrcode/)
 * [IMGspider-轻量外链图片采集插件](https://wordpress.org/plugins/imgspider/)
 * [WP资源下载管理-快速打造资源下载博客网站](https://wordpress.org/plugins/download-info-page/)
 * [Kill 429-完美解决WordPress的429报错问题](https://wordpress.org/plugins/kill-429/)
 * 更多主题和插件，请访问[wbolt.com](https://www.wbolt.com/?utm_source=wp&utm_medium=link&utm_campaign=cht)!

如果你在WordPress主题和插件上有更多的需求，也希望您可以向我们提出意见建议，我们将会
记录下来并根据实际情况，推出更多符合大家需求的主题和插件。

致谢！

闪电博团队

## Screenshots

 * [[
 * HTML代码优化工具设置界面截图.
 * [[
 * HTML代码优化工具文章编辑操作界面截图.

## Installation

方式1：在线安装(推荐)

 1. 进入WordPress仪表盘，点击“插件-安装插件”：

* 关键词搜索“HTML代码优化工具”，找搜索结果中找到“HTML代码优化工具”插件，点击“现在
安装”；
 * 或者点击“上传插件”-选择“HTML代码优化工具”插件压缩包clear-html-tags.zip，
点击“现在安装”。 2. 安装完毕后，启用 `HTML代码优化工具` 插件. 3. 通过“设置”->“HTML
代码优化工具” 进入插件设置界面进行插件参数设置. 4. 编辑文章时，点击编辑器“清楚代码”
按钮执行操作即可。

方式2：上传安装

FTP上传安装
 1. 解压插件压缩包clear-html-tags.zip，将解压获得文件夹上传至wordpress
安装目录下的 `/wp-content/plugins/`目录. 2. 访问WordPress仪表盘，进入“插件”-“已安装
插件”，在插件列表中找到“HTML代码优化工具”，点击“启用”. 3. 通过“设置”->“HTML代码优
化工具” 进入插件设置界面. 4. 编辑文章时，点击编辑器“清楚代码”按钮执行操作即可。

仪表盘上传安装
 1. 进入WordPress仪表盘，点击“插件-安装插件”； 2. 点击界面左上方的“
上传按钮”，选择本地提前下载好的插件压缩包clear-html-tags.zip，点击“现在安装”； 3.
安装完毕后，启用»HTML代码优化工具»插件； 4. 通过“设置”->»HTML代码优化工具»进入插
件设置界面. 4. 编辑文章时，点击编辑器“清楚代码”按钮执行操作即可。

## FAQ

### 为什么该插件在古腾堡编辑器不生效？

插件暂时不支持古腾堡编辑器，我们将来会根据古腾堡编辑器的发展情况及成熟程度再考虑
兼容。关闭古腾堡编辑器使用经典编辑器，可以通过安装插件Disable Gutenberg实现。

### 在升级插件版本时遭遇429 too many requests报错？

这是由于WordPress官方服务器限制了中国区域请求导致，你可以通过安装[Kill 429](https://www.wbolt.com/plugins/kill-429?utm_source=wp&utm_medium=link&utm_campaign=cht)
这个插件来解决这个问题。

### 自定义代码标签格式是否需要输入完整的和？

不需要，你无需输入<>及</>，只需要输入标签名即可。

## Reviews

![](https://secure.gravatar.com/avatar/03da1019df2ebec6b81278b1518a6d4b347c7fa03a1c24cfa3eaa482835ffe1c?
s=60&d=retro&r=g)

### 󠀁[很棒的插件](https://wordpress.org/support/topic/%e5%be%88%e6%a3%92%e7%9a%84%e6%8f%92%e4%bb%b6-9/)󠁿

 [俊](https://profiles.wordpress.org/mmking/) 26 Қаңтар, 2022

非常好的插件，感谢作者！

![](https://secure.gravatar.com/avatar/d498530de4aa463df42fb077c066ab51e4b5879d5f9f52354d20b6ad4d38f9f3?
s=60&d=retro&r=g)

### 󠀁[Great](https://wordpress.org/support/topic/great-14091/)󠁿

 [mpst](https://profiles.wordpress.org/mpst/) 24 Желтоқсан, 2021

Very useful plugin

 [ Read all 1 review ](https://wordpress.org/support/plugin/clear-html-tags/reviews/)

## Contributors & Developers

“HTML代码优化工具” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ wbolt.com ](https://profiles.wordpress.org/wbolt/)
 *   [ mrkwong ](https://profiles.wordpress.org/mrkwong/)

[Translate “HTML代码优化工具” into your language.](https://translate.wordpress.org/projects/wp-plugins/clear-html-tags)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/clear-html-tags/), 
check out the [SVN repository](https://plugins.svn.wordpress.org/clear-html-tags/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/clear-html-tags/)
by [RSS](https://plugins.trac.wordpress.org/log/clear-html-tags/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.1.1

 * 修复保存设置权限安全问题；
 * 修复可能存在xss攻击漏洞问题。

#### 1.1.0

 * 新增可删除HTML代码标签8种（共41种）；
 * 新增可删除的HTML代码标签属性2种（共10种）；
 * 新增可删除HTML代码标签及标签属性自定义功能；
 * 新增代码格式优化功能；
 * 进一步优化插件用户体验，支持插件默认参数设置及当前文章操作临时参数设置。

#### 1.0.0

 * 新增33种可清理的HTML代码标签
 * 新增8种可清理的HTML代码标签属性
 * 新增清理代码标签及标签属性设置功能

## Meta

 *  Version **1.1.2**
 *  Last updated **4 года ago**
 *  Active installations **100+**
 *  WordPress version ** 5.5 or higher **
 *  Tested up to **6.0.11**
 *  PHP version ** 5.3.3 or higher **
 *  Language
 * [English (US)](https://wordpress.org/plugins/clear-html-tags/)
 * Tag
 * [html](https://kk.wordpress.org/plugins/tags/html/)
 *  [Advanced View](https://kk.wordpress.org/plugins/clear-html-tags/advanced/)

## Ratings

 5 out of 5 stars.

 *  [  2 5-star reviews     ](https://wordpress.org/support/plugin/clear-html-tags/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/clear-html-tags/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/clear-html-tags/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/clear-html-tags/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/clear-html-tags/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/clear-html-tags/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/clear-html-tags/reviews/)

## Contributors

 *   [ wbolt.com ](https://profiles.wordpress.org/wbolt/)
 *   [ mrkwong ](https://profiles.wordpress.org/mrkwong/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/clear-html-tags/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://www.wbolt.com/)