HTTP/2 WordPress Apache: How to Enable it on Your Site

Enabling HTTP/2 on your WordPress website hosted on an Apache server brings numerous performance benefits. This guide will walk you through the steps to enable HTTP/2 on your WordPress website hosted on an Apache server.

HTTP/2 WordPress Apache configuration by Attila Bögözi

Prerequisites of Enabling HTTP/2 WordPress Apache

  • Root access to your Apache server
  • Basic understanding of Apache configuration files
  • A running WordPress website

Step 1: Verify Current HTTP Version

Before making any changes, it’s a good idea to check if your website already supports HTTP/2. Use the KeyCDN HTTP/2 Test tool to verify. Simply fill the URL field and test your website for HTTP/2.

screenshot of the HTTP2 tester tool at
Screenshot of the HTTP2 tester tool used on my blog. Courtesy of

Step 2: Locate Apache Configuration File

SSH into your server and navigate to your Apache sites-available directory, usually located at /etc/apache2/sites-available/. Assuming that you already have a valid SSL certificate (a critical step for enabling HTTP/2 on Apache), look for the SSL-enabled configuration file for your WordPress website, which often ends in -le-ssl.conf.

Step 3: Edit Apache Configuration File

Open the configuration file using a text editor like nano.

Add the following line inside the <VirtualHost *:443> block:

Save and exit the editor.

Step 4: Check Loaded Apache Modules

Run the following command to see a list of loaded Apache modules:

Ensure that http2_module is in the list. If not, you’ll need to enable it.

Step 5: Switch to Compatible MPM Module

HTTP/2 is not compatible with Apache’s mpm_prefork module. You need to switch to a compatible MPM module like mpm_event which is a necessity for harnessing HTTP/2’s benefits on your WordPress Apache setup.

Disable mpm_prefork:

Enable mpm_event:

Step 6: Configure PHP to Work with New MPM Module

Aligning PHP to work seamlessly with your newly selected MPM module entails a detailed inspection of your current PHP version, followed by module adjustments to uphold optimal performance under the HTTP/2 protocol.

First, find out which PHP version you are running with:

This will show you the version you have installed (e.g., PHP 7.4.10 or PHP 8.0.3).

If you are using PHP 7.4:

Disable the PHP 7.4 module:

Enable PHP 7.4 FPM:

If you are using PHP 8.0:

Disable the PHP 8.0 module:

Enable PHP 8.0 FPM:

Step 7: Restart Apache

The culmination of your efforts is signified by restarting the Apache server, a move that finalizes the enablement of HTTP/2 for your WordPress site on Apache, marking a significant milestone towards enhanced site performance.

Restart your Apache server to apply the changes:

Step 8: Verify HTTP/2 WordPress Apache Support

Use the KeyCDN HTTP/2 Test tool again to confirm that your website now supports HTTP/2.

And there you have it! You’ve successfully enabled HTTP/2 for your WordPress website on Apache. This should help improve the loading speed and overall performance of your website.

I also have an article about how to Troubleshoot Common WordPress issues. Check it out!

If you encounter any challenges with your Apache or HTTP/2 configurations, feel free to leave a comment below. I’ll do my best to assist you in resolving any issues.

3 thoughts on “HTTP/2 WordPress Apache: How to Enable it on Your Site”

What do you think?

This site uses Akismet to reduce spam. Learn how your comment data is processed.