Empty P Tag
Empty P Tag
Description
Empty P Tag helps you keep clean front-end markup when WordPress, themes, or builders insert unwanted empty <p> / <br> tags that create awkward spacing.
What it does
- Removes empty paragraph tags (including whitespace-only and
paragraphs) - Optionally disables WordPress
wpautopon content, excerpts, and text widgets - Gives you a Settings screen so you can choose exactly where cleanup runs
- Stays lightweight: front-end cleaning runs only where you enable it
Useful when
- Page builders or custom HTML layouts pick up extra vertical space
- Classic editor / mixed content leaves empty paragraphs behind
- You want
wpautopoff in some places, but normal paragraphs elsewhere
Default settings match older versions of this plugin, so existing sites keep the same behavior after upgrading.
Release Notes
Version 5.0.0 – Major update
This release rebuilds Empty P Tag around a proper settings experience while keeping the previous default behavior for existing sites.
Highlights
- New admin page at Settings Empty P Tag
- Turn WordPress automatic paragraphs (
wpautop) on or off for content, excerpts, and text widgets - Choose where empty paragraph cleanup should run
- Improved matching for empty paragraphs that contain only spaces,
, line breaks, or invisible characters - Option to also remove empty paragraphs that include HTML attributes (for example a class)
- Optional setting to collapse consecutive / stray line break tags
- Quick Settings link on the Plugins screen
- Translation-ready (text domain:
empty-p-tag) - Settings are removed cleanly on uninstall
- Compatibility updates: requires PHP 7.2+, tested up to WordPress 6.8
Upgrade notes
- After updating, review Settings Empty P Tag
- Defaults match the older always-on behavior, so most sites will look the same after upgrade
- If your theme needs normal WordPress paragraphs, disable the
wpautopoptions and leave empty-tag cleanup enabled
Installation
From the WordPress admin
- Go to Plugins Add New.
- Search for Empty P Tag.
- Click Install Now, then Activate.
- Open Settings Empty P Tag to review options.
Manual install
- Upload the
empty-p-tagfolder to/wp-content/plugins/. - Activate Empty P Tag from the Plugins screen.
- Configure options under Settings Empty P Tag.
Faq
Yes on the front end. The plugin filters rendered content; it does not rewrite post content in the database.
Only if those options stay enabled. You can turn off wpautop removal per area (content, excerpt, widgets) and still strip empty tags.
Open Settings Empty P Tag and restore the defaults, or disable only the option that conflicts with your theme.
Yes. Filters include haq_empty_p_tag_should_clean and haq_empty_p_tag_cleaned_content.
Reviews
Does the trick
By garrongray on September 3, 2020
Saved my commenting system!
By alexcz on June 19, 2020
It is simple and amazing plugin
By meenakshi1995 on February 9, 2019
Awesome...
By kundanfortest on May 4, 2018
Great Plugin
By alexmartelli97 on October 28, 2017
Great
By nidhibarve on October 11, 2017
Easy and best performance
By Husain Ahmed (husainahmedqureshi) on October 28, 2017
Changelog
5.0.0
- Major rewrite with a Settings screen (Settings Empty P Tag)
- Choose where to disable wpautop (content, excerpt, widgets)
- Choose where empty paragraph cleanup runs
- Stronger empty-tag matching (
, zero-width spaces, attribute-bearing empty paragraphs) - Optional collapse of extra
<br>tags - Plugin action link to Settings
- Translation-ready text domain
- Clean uninstall that removes stored settings
- Requires PHP 7.2+, tested with modern WordPress
4.1
- Internal maintenance release
3.0
- WordPress.org compatibility updates
2.0.1
- Third release
- Added feature to remove whitespace-only paragraph tags
1.0.1
- Second release
- Added
preg_replacecleanup for empty tags
1.0.0
- First release
- Basic plugin