Lighthouse Documentation

Table of Contents

Introduction

Configuration

As you install Lighthouse for the first time, you get a dashboard section (SettingsLighthouse) showing you a summary of your options and your system settings. You also get a list of optimization presets.

By selecting certain options, you can save page requests (prevent unused styles and scripts from loading) and database queries (prevent unused database queries from being performed, thus saving precious loading time). The list continues to show the total number of options you have selected, the total number of recommended options and several cache values, if you decide to enable them (otherwise they stay at zero).

If you are a complete WordPress beginner, I advise using a preset, then navigating through the options and see what each one does. If you can find your way around WordPress or if you’ve read stuff online, I advise you to check each option in the list below, enable them gradually and check the site’s performance. Note that some options will be effective after 5 to 10 minutes.

Keep reading below to see an overview of the available options.

Performance Settings

Zen mode

This option removes most of WordPress-related information, notifications, dashboard meta boxes, widgets, WordPress logos and version details.

It also removes some (mostly) unused taxonomies, such as link categories and post formats, and declutters the admin bar. You can use this option for client sites, where you want to remove the WordPress logo and the avatar function and make the backend looking more white-label.

Performance

This option speeds up internal browsing, as the feature helps detect and preload user clicks. When a user hovers over a link, prerender and/or prefetch hints are dynamically appended to the <head> of the document, but only if those respective hints haven’t already been generated in the past.

Enabling this option will make loading subsequent pages seem instant. However, if users don’t usually click on internal pages, but prefer to only browse and hover links, they will be loaded and never used, increasing the server load. Use it only if needed, and keep an eye on user engagement and bounce rate to see if it has any effect.

Theme Clean-up

Remove version parameter from scripts and stylesheets

This option removes version parameter from scripts and stylesheets URLs in order to help with browser caching.

Disable emojis and smilies

This option disables replacing special characters with emojis and smilies and stops the emoji scripts/styles loading, saving several requests and queries. This option also disables all content parsing (clickable links, smilies conversion, bbCode conversion and other WordPress-specific parsing).

Disable canonical URL redirection

This option disables URL redirection when a page is not found. By default, WordPress redirects a non-existent page to the closest permalink it finds.

Disable author archive

This option disables author archives and helps with search engine indexation, duplicate content and security.

Remove prepend_attachment filter from the_content()

This option removes the prepend_attachment filter from the_content() to fix conflicts with specific page builders.

<head> Clean-up

Clean up theme <head>

This option removes RSD, WLW references, WordPress generator tag and post shortlinks from the theme’s <head> section. It also removes WordPress-generated <rel> tags (search engines do not use them any more). These details are not needed in 90% of the cases.

This option removes RSS links and prevents content copying and republishing.

System Clean-up

Disable comment cookies

This option disables the user information – name, email, and website – being saved in a browser cookie. This is usually done to have the details autocompleted in the comment form. Only check this option if you don’t have a comment-heavy site.

Disable WordPress embeds

This option removes embed query variables, disables oEmbed discovery and completely removes the related scripts (disallows WordPress posts to be embedded on remote sites).

Disable mediaelement.js

mediaelement.js is a JavaScript library used by WordPress to provide enhanced media playback functionality, such as video and audio players. When this option is enabled, it will remove the mediaelement.js library from your website if any page functionality does not require it.

There are several reasons why you might want to disable mediaelement.js.

  1. Reduce page load times: By removing the library from your site, you can decrease the number of files that need to be loaded, thereby improving the site’s performance and reducing page load times.
  2. Avoid potential conflicts: If you are using a theme or plugin that already includes its own media player, mediaelement.js might cause conflicts and affect the functionality of the other player.

Server Load

Slow down the WordPress heartbeat

The WordPress heartbeat is a feature that allows the WordPress admin interface to communicate with the server in real-time. This feature uses AJAX requests to periodically check for updates, such as post revisions, plugin updates, and user activity. By default, the WordPress heartbeat sends requests every 15 seconds on post edit screens and every minute on dashboard screens.

Enabling the “Slow down the WordPress heartbeat” option will increase the time interval between these requests. This can have several performance benefits:

  1. Reduced server load: By decreasing the number of requests being sent to the server, you can reduce the load on the server and improve its performance. This is especially important if you have many users or if your server has limited resources.
  2. Improved user experience: The WordPress heartbeat can sometimes cause slow loading times and unresponsive admin screens, particularly on shared hosting environments or on servers with limited resources. By slowing down the heartbeat, you can improve the user experience by reducing the likelihood of these issues occurring.
  3. Reduced network traffic: The WordPress heartbeat can generate a significant amount of network traffic, particularly if you have many users or if you are accessing your site over a slow network connection. Slowing down the heartbeat can reduce the amount of network traffic generated by your site, making it faster and more responsive.

It’s worth noting that slowing down the WordPress heartbeat may not be necessary for all sites. If you have a small number of users and a powerful server, you may not see any performance benefits from enabling this option. However, for larger sites or sites with limited resources, enabling this option can be a simple and effective way to improve performance and reduce server load.

Security Settings

Read the official WordPress guidelines for hardening and securing your site.

Basic security

Normalize HTTP(S) scheme

This option forces the use of HTTP/HTTPS based on the active WordPress settings and is useful when switching from HTTP to HTTPS or to minimize mixed content warnings.

Disable XML-RPC

This option disables remote access to your WordPress site (may cause issues with some plugins). Please reconsider the use of plugins which request XML-RPC access.

Enable brute force protection

Enabling brute force protection will prevent bots and hackers from attempting to log in to your website with common username and password combinations


Minify Settings

Minify/compress HTML source code

Minify HTML

Minification is the process of removing unnecessary characters from HTML code without changing its functionality. This includes removing whitespace, comments, and other extraneous characters. Minifying HTML can reduce the size of the HTML file, making it load faster and reducing the amount of data that needs to be transferred to the user’s browser.

Minify inline JavaScript

Similar to HTML minification, minifying inline JavaScript involves removing unnecessary characters from JavaScript code. This includes removing whitespace, comments, and other characters that do not affect the code’s functionality. Minifying inline JavaScript can reduce the amount of data that needs to be transferred to the user’s browser, improving page load times.

Remove HTML, JavaScript, and CSS comments

Comments in HTML, JavaScript, and CSS code are used by developers to add notes and descriptions to their code. However, these comments are not necessary for the code to function correctly, and they can increase the file size of the code. Removing comments can reduce the size of the code, making it load faster and reducing the amount of data that needs to be transferred to the user’s browser.

Remove (X)HTML closing tags from HTML5 void elements

HTML5 void elements are elements that do not have a closing tag, such as the <img> and <br> tags. In HTML5, it is not necessary to include a closing tag for these elements. However, some older browsers may not recognize this syntax, and including the closing tag can make the code more compatible with these browsers. Removing the closing tag can reduce the size of the code and improve page load times, but it may also reduce compatibility with older browsers.

Support multibyte UTF-8 encoding (if you see odd characters)

Multibyte UTF-8 encoding is a character encoding system that allows for the representation of a wide range of characters and symbols. If you see odd characters on your website, it may be because your website is not properly supporting multibyte UTF-8 encoding. Enabling support for multibyte UTF-8 encoding can ensure that all characters and symbols are displayed correctly on your website.


Theme Settings

Theme tweaks

Disable HTML in WordPress comments
This option disables HTML code in WordPress comments. HTML is sometimes used for bold/italic text or links.

Remove Dashicons from front-end for non-administrators
This option removes the Dashicon font from front-end for non-administrators, if the theme doesn’t require Dashicons.

Remove comment reply script (if using a third-party comments plugin)
This option removes the reply script, usually enqueued in <head>, if the theme uses no comment replying or a third-party comments plugin (Disqus, Jetpack, etc).

Widget tweaks

Remove X widget (WP_Widget_X)
These options remove the respective widgets, making the Appearance -> Widgets section faster.