RS Head Cleaner Plus Plugin for WordPress

RS Head Cleaner Plus Plugin for WordPress removes junk code from the head section, improves speed, efficiency, security, & SEO.

Overview

 
This plugin cleans up a number of issues, doing the work of multiple plugins, improving speed, efficiency, security, SEO, and user experience. It removes junk code from your WordPress head section; moves JavaScript from the header to footer; combines, minifies, and caches CSS and JavaScript files; hides the Generator/WordPress Version number; removes version numbers from CSS and JS links in the head; and changes the “Read more” link so it displays the entire post.

Translate This

Translate »
  • 18
  • 18
  • 18
  • 18
  • 18
  • 18
  • 18
  • 18
  • 18
  • 18
  • 18
  • 18
  • 18
 

Features

 

Why Do I Need RS Head Cleaner Plus?

 
Here’s a more detailed explanation of what the plugin does.

Remove the WordPress Version Number

The code for the WordPress version number is in the HEAD section of your page and looks like this:

<meta name='generator' content='WordPress 2.7' />

Showing the WordPress version in your site code exposes your site to hackers. Many exploits are version-specific, and even if you keep you blog up to date, there are zero-day exploits that occur before a new version can be released to patch the problem. Hackers run automated programs call “bots” to scour sites looking for this line of code with WordPress versions, and when they find one that matches the version of the exploit they are looking to launch, they send another bot to those sites to launch the attack.

That’s why it’s important to remove the WordPress version number from your site. (Obviously you need to secure your site using more than just this one method.)

Once you activate this plugin, the WordPress version will disappear from your site code.

Remove the Version Numbers from CSS and JS Links in the HEAD

By default WordPress inserts version numbers into the CSS links in the HEAD section of your page and looks like this:

<link rel='stylesheet' id='example-css' href='http://www.yourblog.com/wp-includes/css/example-css.css?ver=3.5.1' type='text/css' media='all' />

<script type='text/javascript' src='http://www.yourblog.com/wp-includes/js/example-js.js?ver=3.5.1'/></script/>

Showing the WordPress version in your CSS and JS links again exposes your site to hackers. For the same reasons we remove the WordPress Generator, you want to remove them from here.

But, that’s not all. Having the version numbers appended to the link keeps browsers from caching the CSS and JS files. If you want your site to run at its fastest, one aspect of that is using caching properly. Removing these version numbers will now allow browsers to cache those files.

One last thing…having version numbers appended to the CSS and JS links causes sites not to validate. So in order to get your site code to validate 100%, you will want to remove those.

Once you activate this plugin, this issue will be fixed and the resulting code will look like this:

<link rel='stylesheet' id='example-css' href='http://www.yourblog.com/wp-includes/css/example-css.css' type='text/css' media='all' />

<script type='text/javascript' src='http://www.yourblog.com/wp-includes/js/example-js.js'/></script/>

Problem solved.

Remove Junk Code from Your Site

This plugin cleans up the HEAD section of your site. For those of you not familiar, that’s the HTML code located between the <HEAD> and </HEAD> tags. WordPress inserts code that can hurt your SEO and site security. This plugin will automatically remove these lines of junk code for you. I’ll explain in a bit more detail.

1 — Remove the The RSD Link

RSD stand for Really Simple Discovery. In a nutshell, it helps remote client software find the info it needs to read and edit the blog. WordPress inserts the following code:

<link rel='EditURI' type='application/rsd+xml' title='RSD' href='http://www.yourblog.com/xmlrpc.php?rsd' />

The RSD link is only needed if you use remote publishing to your blog. If you only edit your blog through a browser (which is true for most people) then it is more secure to remove this from the header. As a general rule and best practice, it’s always better to have clean code and remove unused code from a site, for efficiency, security and SEO.

2 — The Windows Live Writer Manifest Link

<link rel='wlwmanifest' type='application/wlwmanifest+xml' href='http://www.yourblog.com/wp-includes/wlwmanifest.xml' />

This is a similar deal to RSD. The bottom line is, if you’re not using Windows Live Writer, remove the WLW Manifest link from the HEAD section of your site code to improve security and SEO.

3 — Remove WordPress Shortlinks from the HEAD and HTTP Headers

Shortlinks is a protocol you can use to specified shortened URL’s for each page in your site code. WordPress has provided its own URL-shortening service. WordPress inserts code in your header that provide a link to the “shortened” URL:

<link rel='shortlink' href='http://www.yourblog.com/?p=1257' />

If you don’t actually request a shortlink when you write your post/page, it will insert the raw unshortened URL into your page. Ouch. If you notice, it matches the default URL structure before you even setup permalinks in the WordPress settings.

Why even have WordPress create clean, SEO-friendly permalinks, if it’s going to ignore your settings and insert junk like this into your site? Not cool. To be clear, these are NOT SEO-friendly URL’s. It’s one thing to use these for Twitter or affiliate links, but its bad idea to include these in your site code. It is not recommended under any circumstance. These should be removed no matter what as they will only hurt your SEO in a number of ways.

That’s not the only place where WordPress places shortlinks. They are also inserted into the HTTP headers. (These are served invisibly to the browser before the page loads.) Again, ouch. See what it looks like:

Link: <http://www.yourblog.com/?p=1257> rel=shortlink

The thing is, this is all according to shortlinks protocol, but WordPress’ implementation is incorrect. If the user has not specifically chosen to create shortlinks, there should not be default “shortlinks” inserted into the site — there should be none at all — and especially not ones that are in the format shown, with SEO-unfriendly URLs, and which expose post ID’s. That’s ok though, this plugin will fix it for you.

4 — Adjacent Posts Links: REL=”PREV” and REL=”NEXT”

WordPress Adjacent links were meant to be an aid in helping with canonical issues with paginated posts on a blog. Unfortunately WordPress’ implementation is incorrect and inserts these on ALL posts/pages, even ones that are not paginated:

<link rel='prev' title='Previous Page' href='http://www.yourblog.com/previous-page/' />

<link rel='next' title='Next Page' href='http://www.yourblog.com/next-page/' />

What this does is create a mess, and hurt your SEO. I’ve seen it list pages in these links that were completely unrelated just because they had sequential post numbers in WordPress. I highly recommended turning off the WordPress’ default implementation (which this plugin will do for you).

Move JavaScripts from the HEAD to the Footer to Speed Up Your Page Load
These days it is important for a number of reasons to speed up your site as much as possible. It even affects your SEO and advertising costs:

  1. Usability — Usability and user-friendliness always needs to be the first concern on your website. It’s important to speed up your page because if you have a slow site, it will eventually drive people away. Make your site faster, and improve user engagement on your site.
  2. SEO — Since 2010, page speed has been a known factor of SEO. (And some believed it was even considered long before that.) Google and Yahoo have both provided speed measurement and improvement tools (Google PageSpeed and Yahoo YSlow) that advise moving whatever JavaScripts (that aren’t absolutely necessary to keep in the HEAD) to the footer of your page in order to speed up loading.
  3. AdWords Quality Score — When you advertise on AdWords, Google assigns a quality score for ad. This affects your costs for advertising if you have a poorer score. Page speed is one of the factors that affects your quality score.

Moving your WordPress JavaScripts to the footer is a major factor in speeding up your page load. This plugin will automatically fix this for you.

Combines, Minifies, and Caches CSS and JavaScript Files to Improve Your Page Load Speed Even More
The plugin now goes far beyond moving JavaScript to the footer:

  1. Combine your WordPress CSS files and JavaScripts into a single CSS file and a single JS file.
  2. Minify your CSS and JavaScript files.
  3. Cache your new condensed CSS and JavaScript files.
  4. The minified JavaScript file will be moved to the footer of the page to speed up page loading.
  5. To improve page load speed when Contact Form 7 is installed, the plugin will only include the JS and CSS for Contact Form 7 on pages that actually use its forms. (It tests the page content for the CF7 shortcode…if none are detected, then the CSS & JS aren’t included.)

All of this has been tested and verified with GTMetrix, which tests websites using Google PageSpeed and Yahoo YSlow, and shows the scores. Check it out for yourself…do a before and after test with your site and watch your Google PageSpeed and Yahoo YSlow Scores improve right before your eyes.

For more information, this is explained in more detail further down the page.

Fixes the “Read More” Link to Improve Usability

By default, on a WordPress site when a visitor sees an archive page with a list of posts (Home Page, Categories, Tags Archives, Date Archives, Search Results, etc.) and they click on the “Read more” link, it takes them to the point in the post where the more tag was inserted (<!--more-->). This plugin fixes that issue, so when a visitor clicks the “Read more” link, it will display the entire post, for an improved user experience.

How the Minification and Caching of CSS and JavaScript Works in this Plugin

 
Browsers can only download a limited number of JavaScript and CSS files at once, so it can create a bottleneck if you have a lot, causing the visitor to experience a slow page load, even on high-speed internet. If you’re using WordPress with a lot of plugins, chances are that many of them add their own CSS and JavaScript files to your page. If you have 20 plugins you might have 10 extra CSS and 10 extra JS files in addition to the ones added by your theme. Ouch! That WILL slow a page down. RS Head Cleaner Plus will reduce all those down to 1 CSS and 1 JavaScript file. (With a few exceptions…certain files can’t be combined…like jquery.)

Page Speed Improvements: What Results Can You Expect?

 
Results will vary on every site. (I have to get that out of the way.) It’s going to depend on how optimized your site already is. But even optimized sites will get excellent results.

This plugin will improve these elements of your Google PageSpeed Score (and more):

It will also improve these elements of your Yahoo YSlow Score (and more):

Real Before and After Examples from GTMetrix:

Google PageSpeed Before/After

Before / After - Google PageSpeed: Minify CSS, Minify JavaScript, Remove query strings from static resources

Yahoo YSlow Before/After

Before / After - Yahoo YSlow: Minify JavaScript and CSS, Make fewer HTTP requests

It will also help improve several other elements of your Google PageSpeed and Yahoo YSlow scores, since many aspects of improving page load speed are related to these.

If you want to see the real difference it makes, go to GTMetrix and run a before and after comparison. Deactivate the plugin and run your “Before” report and print it or save as a PDF, and then reactivate it and run your “After” report and print it or save as a PDF. (This works best if you disable caching on your site and clear the file cache before you run these.) Then compare your two reports to see the difference.

When you run your reports, pay attention to the elements mention in the Before/After examples above, and also pay attention to:

These improvements in page loading speed may also help your website’s SEO, in particular your Google rankings, because website speed is a factor in ranking now. I suspect it will become an even more important part of the ranking algorithm as time goes on.

For Best Results

 
If you REALLY want your site speed to increase, use this in combination with WP Super Cache. Use the “mod_rewrite” method, and then the “Preload” option to preload the the pages of your site. What this will do is go through your site, and create a cached version of every page before anyone ever visits the page, so it will be super fast on the first visit. This will also ensure that all the cache files for RS Head Cleaner Plus are created before anyone visits.

Make sure when you install this plugin and activate it, if you ARE using caching software, have your plugin delete the file cache first thing, otherwise the new improvements won’t go into effect until it refreshes the cache.

Installation Instructions

 
Option 1: Install the plugin directly through the WordPress Admin Dashboard (Recommended)

  1. Go to Plugins -> Add New.
     
  2. Type RS Head Cleaner Plus into the Search box, and click Search Plugins.
     
  3. When the results are displayed, click Install Now.
     
  4. When it says the plugin has successfully installed, click Activate Plugin to activate the plugin (or you can do this on the Plugins page).
     

Option 2: Install .zip file through WordPress Admin Dashboard

  1. Go to Plugins -> Add New -> Upload.
     
  2. Click Choose File and find rs-head-cleaner.zip on your computer’s hard drive.
     
  3. Click Install Now.
     
  4. Click Activate Plugin to activate the plugin (or you can do this on the Plugins page).
     

Option 3: Install .zip file through an FTP Client (Recommended for Advanced Users Only)

  1. After downloading, unzip file and use an FTP client to upload the enclosed rs-head-cleaner directory to your WordPress plugins directory (usually /wp-content/plugins/) on your web server.
     
  2. Go to your Plugins page in the WordPress Admin Dashboard, and find this plugin in the list.
     
  3. Click Activate to activate the plugin.
     

Changelog

 

Version 1.3.1, released 07/12/14

Version 1.3, released 07/03/14

Version 1.1.1, released 06/17/14

Version 1.1.0.3, released 04/28/14

Version 1.1.0.2, released 04/13/14

Version 1.1.0.1, released 04/04/14

Version 1.1.0.0, released 03/26/14

Version 1.0.0.0, released 03/17/14

Frequently Asked Questions

 
Q: Where are the options?

A: This plugin is fast, and lean…there are no options needed. You install it and it just works.

Q: Does this plugin have any known issues?

A: Just one that I know of.

Moving JavaScript to the footer of your page may create issues with some responsive themes that need the JS libraries to be in the head section of the code. If that’s the case then this plugin may not be right for you. Even for me, it’s right for 80% of my sites but not all of them. For the rest I put everything but the JavaScript-to-Footer code in the functions.php file of the theme to get similar functionality.

Test this plugin out on your site before deciding if it will be the right solution for you. Normally I would create an options page to let you turn the JS-to-Footer feature off, but this plugin is all about speeding up your site, and that means minimal calls to the database, so unfortunately it would defeat the purpose of this plugin if I added the ability to change that.

In this case, use the RS Head Cleaner Lite Plugin.

Q: But I already have a Caching Plugin like WP Super Cache installed? Why do I need CSS and JS caching?

A: Caching plugins like WP Super Cache are awesome…in fact I recommend everyone use caching plugins, especially WP Super Cache. But it doesn’t help speed up the CSS and JavaScript files downloading. It speeds up the actual PHP and database calls by creating static HTML files. If you have a lot of plugins and have 10 JS and 10 CSS files that have to download on every page, that can still bottleneck and slow your site down. This plugin will reduce those down to 1 JS and 1 CSS that have to be downloaded. Combined with a caching plugin, your site will be even faster.

Q: What if I Don’t Want to Have My Page’s CSS Files Cached?

A: This plugin is built for speed. That’s why it doesn’t have an options page, because I didn’t want it to have any database calls, which would slow it down. After a certain amount of database calls, you lose any speed improvements. Amazon.com found that for every 100 milliseconds (1/10th of a second) their site slowed down, they lost 1% in sales. Ouch.

This new feature is integral to the plugin, so the caching isn’t a feature you want, then this plugin won’t be the right match for you. It’s designed for people that are very speed conscious, and want hardcore solutions.

Download

 
Download RS Head Cleaner Plus Plugin (.zip)

If you need a version that doesn’t have the JS to Footer code, try RS Head Cleaner Lite:
Download RS Head Cleaner Lite Plugin (.zip)

Support

 
WordPress Plugin Support