Recognized as the most powerful caching plugin by WordPress experts
Minimal Configuration, Immediate Results
Don’t waste your time struggling with complex plugin settings. WP Rocket launches upon activation.
Today I’m going to discuss a new, and very nice, site speed improvement that became possible in WordPress 4.1. What changed? The introduction of a new filter,
script_loader_tag. This filter lets us easily change the HTML markup of
headcan delay your browser from displaying page content, because its default behavior is first to interpret the JS files themselves.
headsection of your HTML document. On the internet as in nature, the main thing about a
headis that it’s above a
“Render-blocking” comes from a web browser’s default behavior: It wants to completely receive and process everything that’s come higher up in the page, before it moves any further down.
headcan actually delay your browser from displaying the page content in the
body, because its default behavior is first to interpret the JS files themselves. In other words, JS is blocking the browser’s crucial function of rendering the page out for the user to actually see. The result can be slow sites and frustrated users.
The first thing to understand is the alternatives to render-blocking JS:
Those are concepts—now for code. (The full code is available on GitHub.)
scriptelement. Letting us filter that HTML is what
script_loader_tagis for. (If you need an update on filters and WordPress’s hooks system in general, start here!)
Ultimate Category Excluder (UCE) is a WordPress plugin that allows you to quickly and easily exclude categories from your front page, archives, feeds, and searches. Just select which categories you want to be excluded and UCE does all the work for you!
You can download this plugin from the WordPress plugin repository.
This plugin has been particularly handy with categories that house useful content, but content that I don’t want to have appear on the homepage or in my feeds. For example, I have a number of definitions for technical terms and while these can help users reading my content, there’s no need to have a definition appear on my homepage or get pushed out via my RSS feeds.
If you have a feature request or have found a bug, please report it below