跳到内容

Empty P Tag

v6.0.0

Husain Ahmed · 2017年10月11日 上架

Remove empty paragraphs and fix awkward spacing without breaking your layout.

正在使用
700+
评分
5.0 / 5
累计下载
9,425
最近更新
2026年11月10日
3 条评价需要 WordPress 5.8+已测试到 7.1.5PHP 7.4+

贡献者

截图

Settings screen with quick presets (Recommended, Classic, Aggressive) and active cleanup status.
Settings screen with quick presets (Recommended, Classic, Aggressive) and active cleanup status.
Live Before → After HTML preview so you can see empty <p> / <br> cleanup before saving.
Live Before → After HTML preview so you can see empty <p> / <br> cleanup before saving.
Scope settings: choose post types and exclude specific post IDs from cleanup.
Scope settings: choose post types and exclude specific post IDs from cleanup.
Block editor sidebar: skip cleanup on one page, or optionally clean permanently on save.
Block editor sidebar: skip cleanup on one page, or optionally clean permanently on save.
Integrations and advanced options: ACF, comments, filter priority, and safer cleanup toggles.
Integrations and advanced options: ACF, comments, filter priority, and safer cleanup toggles.

Empty P Tag keeps your front-end markup clean when WordPress, themes, builders, or editors insert unwanted empty <p> / <br> tags that create awkward spacing.

The problem

Empty paragraphs and stray breaks often appear after pasting content, mixing classic and block markup, or using WYSIWYG fields. They push layouts apart and are hard to spot in the visual editor.

What it does

  • Removes empty paragraph tags (including whitespace-only and &nbsp; paragraphs)
  • Optionally disables WordPress wpautop on content, excerpts, and text widgets
  • Cleans comments, term descriptions, and Advanced Custom Fields (optional)
  • Limits cleanup by post type or excluded post IDs
  • Lets you skip cleanup on a single post/page
  • Optional per-post clean-on-save for permanent database cleanup (off by default)
  • Live Before After HTML preview on the settings screen
  • One-click presets: Recommended (safe), Classic, or Aggressive

Safety first

Front-end cleanup is non-destructive: the plugin filters rendered output and does not rewrite post content in the database unless you explicitly enable clean-on-save on a post.

Useful when

  • Classic editor / mixed content leaves empty paragraphs behind
  • Comment systems or WYSIWYG fields add extra vertical space
  • You want wpautop off in some places, but normal paragraphs elsewhere
  • You need ACF WYSIWYG output without empty spacer paragraphs

Page builders

Plugins like Elementor often render outside the_content. Empty P Tag cleans WordPress content filters (posts, excerpts, widgets, comments, terms, ACF). It does not rewrite every builder canvas.

Privacy

This plugin does not collect, store, or send personal data. There is no telemetry.

Developers

Filters include:

  • haq_empty_p_tag_settings
  • haq_empty_p_tag_should_clean
  • haq_empty_p_tag_before_clean
  • haq_empty_p_tag_clean_pattern
  • haq_empty_p_tag_cleaned_content

Release Notes — Version 6.0.0

This release turns Empty P Tag into a clearer, safer, more flexible cleanup tool while keeping older sites stable.

What’s new

  • One-click presets: Recommended (safe), Classic Empty P Tag, and Aggressive spacing fix
  • Live Before After HTML preview on the settings screen
  • Cleanup for comments, category/term descriptions, and optional ACF fields
  • Limit cleanup by post type or excluded post IDs
  • Per-post Skip cleanup control (classic editor + block editor sidebar)
  • Optional per-post clean-on-save (off by default — only rewrites the database when you choose it)
  • Safer cleaner: optional HTML tag balancing, configurable filter priority
  • Multisite-aware uninstall and updated WordPress.org documentation/assets
  • Requires PHP 7.4+, WordPress 5.8+, tested up to WordPress 7.1

Upgrade notes

  • Existing sites keep classic defaults for missing settings so layouts should not suddenly change
  • New installs get the Recommended (safe) preset: empty-tag cleanup on, wpautop left alone
  • After updating, open Settings Empty P Tag and review the active preset

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums