Head Cleaner


Cleaning tags from your WordPress header and footer.
To speed up the loading of JavaScript and CSS.

PHP5 以降のみ対応です。


  • IE6 以外の時は先頭に xml 宣言を付与。
  • 重複タグや、不要なタグ、コメント、空白を削除。
  • <meta Name="description" /> タグが複数ある場合、一つにまとめる
  • <meta Name="keyword" /> タグが複数ある場合、一つにまとめる
  • <link rel="canonical" /> タグを追加。
  • OGP (Open Graph Protocol) に対応したタグを追加。
  • IE コンディショナルタグを判定して、ブラウザが IE の時だけ対象タグを表示。
  • CSS, JavaScript, if your browser supports gzip compression transfer.
  • Have multiple CSS files into the media and a binding for each attribute.
    Of course, the file contains inline CSS.
  • CSS を圧縮する。
  • CSS に含まれる画像の URL を、データスキーマ URI に変換する。
  • Have multiple JavaScript files into a binding and all.
    Of course, the file also includes an inline JavaScript.
  • JSMinで、JavaScript のソースコードを圧縮する。
  • JavaScript をフッタ領域に移動することもできる。
  • フッタ領域の JavaScript も同様に結合して一ファイルにまとめる。
  • Prototype.js, script.aculo.us, jQuery, mootools が複数読み込まれている場合、1回だけ読み込むようにする。
  • Prototype.js, script.aculo.us, jQuery, mootools の読み込み順を修正して、できるだけコンフリクトが発生しないようにする。


“Head Cleaner” has been translated into languages. Our thanks and appreciation must go to the following for their contributions:

If you have translated into your language, please let me know.


  1. head-cleaner screenshot 1

    The admin page

  2. head-cleaner screenshot 2

    YSlow Result


  1. Upload the entire head-cleaner folder to the /wp-content/plugins/ directory.
  2. Please make js and css a directory under the /wp-content/cache/head-cleaner/ directory.
  3. 「プラグイン」メニューからプラグインを有効化します。

Head Cleaner のオプション設定は “設定 > Head Cleaner” で行えます。

PHP libraries are using Simple HTML DOM Parser and JSMin. PHP5 Required.


If you want to exclude certain statements in shaping the header.php theme needs to be modified.
Specifically, the portion to be excluded from shaping Please describe below.

The theme you are using plug-ins do not work together properly.
If you do not work properly, after stopping all the other plug-in plug-in,
To activate each one, please check if any conflicts with plugins.

CSS, JavaScript caches is not made.

Two directories: CSS, JavaScript caches.
If you want to enable the cache, please create a folder.

  • wp-content/cache/head-cleaner/css
  • wp-content/cache/head-cleaner/js
PHP Warning: get_browser(): browscap ini directive not set in head-cleaner.php

In order for this to work, your browscap configuration setting in php.ini must point to the correct location of the browscap.ini file on your system.
see. PHP: get_browser

Head Cleaner Ver.1.1.5 includes ‘php_browscap.ini’ .


Little bit useless

This plugin minified my theme’s CSS like this, but calc() property needs spaces between each operators.

Developer tool on Firefox

Before minify, this is correct:
Before minify

Warning! Destroys WordPress Admin!

php error messages from this plugin will make your admin area unusable, you will not be able to disable the plugin via the wordpress admin, so take care!



Head Cleaner はオープンソースソフトウェアです。以下の人々がこのプラグインに貢献しています。


“Head Cleaner” をあなたの言語に翻訳しましょう。

開発に興味がありますか ?

コードを閲覧するか、SVN リポジトリをチェックするか、開発ログRSS で購読してみてください。


1.4.4 – Janualy 18, 2017
Support WordPress 4.7

1.4.3 – December 22, 2015
Support WordPress 4.4.
Thx msng – August 29, 2014
Minor bug fix. – April 20, 2012
Fixed a bug, input value validate issue. – December 13, 2011
Support for WordPress 3.3. – June 8, 2011
Support for WordPress 3.2. – April 26, 2011
Fixed a bug, wp_die() error messages none at line 3021. – April 20, 2011
Fixed a bug, html tag issue.

1.4.2 – April 20, 2011
Add an item to the Options page set.
(Added the option to “Add Last-Modified tag” and “Paranoia mode”) – March 8, 2011
Minor bug fixes. thx [HaRD](http://www.karuta.org/wp/ HaRD) ! – January 25, 2011
Fixed a bug, Canonical tag issue.

1.4.1 – January 19, 2011
Add OPG (Open Graph Protocol) tags.

1.4.0 – December 2, 2010
URLs of images in CSS will be converted into the data scheme URIs.

1.3.13 – August 20, 2010
Twenty Ten Themes support.

1.3.12 – August 11, 2010
Fixed a bug, IE Conditional tags.

1.3.11 – July 7, 2010
Minor bug fixes.

1.3.7 – April 15, 2010
Fixed a bug, css @import interpreting the instructions.

1.3.6 – February 15, 2010
Minor bug fixes.

1.3.5 – February 10, 2010
Fixed a conflict with “wpSEO“.

1.3.4 – February 9, 2010
Fixed a conflict with “All in One SEO Pack“.

1.3.3 – January 27, 2010
Add an item to the Options page set.
(Added the option to remove the JavaScript)

1.3.2 – January 25, 2010
In the inline CSS “@import”, <link rel="stylesheet"> was modified to convert the tag.

1.3.1 – September 8, 2009
Minor bug fixes.

1.3.0 – July 5, 2009
Google AJAX Libraries support.

1.2.0 – April 5, 2009
Add an item to the Options page set.

1.1.3 – March 19, 2009
Adjust the filter to display the active filters.

1.1.2 – March 17, 2009
Minor bug fixes.

1.1.1 – March 10, 2009
JavaScript, filter set an expiration date of the analysis.

1.1.0 – March 9, 2009
JavaScript has to be moved to the footer.

1.0.3 – March 7, 2009
Fixed a bug in IE conditional tags Decision.

1.0.2 – March 7, 2009
Fixed a conflict with “WordPress.com Stats” and “Ultimate Google Analytics“.

1.0.1 – March 6, 2009
script.aculo.us was to correct the load order.

1.0.0 – March 5, 2009
Initial release.