This plugin hasn’t been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

This plugin has been closed and is no longer available for download.

WP-Beautifier

Description

Beautifier provides the following options to clean up WP’s messy (X)HTML source code output:

  • Strip unnecessary whitespace, like new lines and trailing whitespace
  • Format (indent) the (X)HTML source code output
  • Remove all HTML comments
  • Convert single quoted tag attributes values into uniform double quoted values
  • Remove anything you want from the output by using custom regular expressions

If something is not working, please read the FAQ or open a topic in the support forum.

Screenshots

  • Clean and nicely formatted HTML-code.

Installation

  1. Upload the /wp-beautifier/ directory and its contents to /wp-content/plugins/.
  2. Login to your WordPress installation and activate the plugin through the Plugins menu.
  3. If desired, refine the plugin’s options in the Settings menu under Beautification.

FAQ

Excuse me, what exactly is this plugin doing?

This plugin provides a bunch of options to change what WordPress is sending to the browser. The text sent to the browser is called HTML/XHTML and you can usually see it by doing a right-click on the page and select something like “View Page Source” or “Show Sourcecode”. This plugin provides the ability to indent all lines correctly for easier reading, the removal of unnecessary whitespace characters, the ability to remove anything you want from the output using regular expressions and a few other options.

This plugin leaves my (X)HTML untouched!

The reason for that is most likely a invalid or missing Doctype declarations (DTD). This plugin only takes action, if a valid (X)HTML DTD is found in the first 200 characters of the page. If you don’t know what a Doctype declarations is, read this article about Doctypes or see this list of valid doctypes for (X)HTML documents.

My HTML source code isn’t indented correct!

Most likly the reason for that is the actual source code output of your WordPress theme is using HTML syntax. This plugin only supports valid XHTML syntax, which can also be used in HTML5 documents.

When I activate the plugin, my theme breaks!

To narrow down the cause, start disabling every single option (under Settings->Beautification) one by one and see if the problem persists. If it persists, deactivate the plugin and copy-paste the working generated (X)HTML source code into a txt-file; afterwards activate the plugin again and copy-paste the broken (X)HTML output into another txt-file. Send these two files to the author with a short description of your problem.

I see a white/blank page where my website used to be!

Try the Reset Options button in the Settings menu under Beautification. If that doesn’t help, deactivate the plugin and contact the author. To resolve your problem faster, attach your server’s PHP error-log-file to the email.

Reviews

Doesn't beautify very well

This looked very promising, but it doesn’t seem to do a very good job of indenting things. It mostly just made a mess of my HTML output and did not seem to improve it any way.

Read all 2 reviews

Contributors & Developers

“WP-Beautifier” is open source software. The following people have contributed to this plugin.

Contributors

Translate “WP-Beautifier” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

1.3.1

  • Renamed Settings menu link and added plugin meta row support links
  • beautifier_add_indention() is now PHP4 compatible
  • Moved beautifier_uninstall() to plugin options file

1.3

  • Added basic RSS and Atom-Feed output cleaning
  • Moved admin related code into options.php file
  • Made most of the language strings easier to understand
  • Added settings link to plugin actions in plugin listing
  • beautifier_clean_whitespace() is now also removing tabs between tags

1.2

  • Prevented permanent E_NOTICE caused by strict ob_start()
  • Added toggle for custom regular expressions
  • Added contextual help to administration menu
  • Added German translation
  • beautifier_uninstall() is now working again
  • Updated language strings and old comments
  • Custom regular expressions are now applied before the code cleaning to enhance their potential
  • Moved the single quotes conversion before the tag preservation
  • Cleaning only if WP_USE_THEMES is defined and a valid DTD is found in the beginning of the output buffer

1.1.1

  • Improved tag preservation to keep <script> tags intact
  • Conditional Comments are not removed anymore
  • Custom regexps are now called after comment removal and quotes conversion
  • Fixed mis-labeled input field id attribute

1.1

  • Renewed many functions and made the descriptions more clear.
  • Added the ability to convert single quotes into double quotes in html tags
  • Added the ability to clean the output with custom regular expressions
  • Prevented an infinite loop, when a html comment is not closed

1.0

  • Initial release