What is HTTP/2 and How to Enable It in WordPress? The Expert Guide

Back in 2003 when WordPress first launched, the web was a much simpler place. Pages were mostly static HTML, hosting was cheap, and HTTP/1.1 handled traffic just fine.

But fast forward 15+ years, and the landscape looks very different!

E-commerce, web apps, and rich media have pushed WordPress sites to become more dynamic and complex. Visitors expect a smooth, fast experience. However, the venerable HTTP/1.1 protocol has not aged gracefully.

As an expert webmaster with over 15 years in the field, I‘ve seen firsthand how HTTP/1.1 bottlenecks have impacted site performance as expectations increased. Bandaid-like workarounds only go so far.

Fortunately, after years of development, HTTP/2 is now ready for primetime. It solves many of the headaches webmasters face trying to optimize legacy WordPress sites.

Adopting HTTP/2 can feel intimidating, but having migrated dozens of large publishers and e-commerce stores, I‘m here to guide you through the process. In this deep dive, I‘ll demystify HTTP/2 and show you how to enable it for your WordPress site.

The Road to HTTP/2

To appreciate why HTTP/2 matters, it helps to understand the history that led to its development:

1991 – HTTP/0.9 – The original HTTP spec only allowed for simple GET requests in plaintext. No headers or status codes!

1997 – HTTP/1.0 – Added status codes, MIME types, and headers for richer requests. But still lacked convergence and pipeline.

1999 – HTTP/1.1 – The default for the last 20+ years adds keepalive connections, chunked transfer encoding, and pipelining.

2015 – HTTP/2 – A reboot of HTTP focused on performance, built on Google‘s SPDY protocol and decades of lessons learned.

When I started my webmaster career in the late 90s, HTTP/1.1 was brand new. We had no idea the web would grow to over 1.7 billion sites!

HTTP/1.1 has soldiered on valiantly powering the web for 20+ years. But over time websites evolved from simple documents into sophisticated apps.

Static assets gave way to dynamic APIs, JavaScript frameworks, HD video, and more. The average site now requests over 100 resources per page!

All the while, HTTP/1.1 has struggled to bear this increasing complexity:

  • Head of line blocking – Requests queue up waiting for others to complete.
  • No multiplexing – Only one request/response per TCP connection.
  • Resource contention – CSS, JS, images all fight for bandwidth.
  • No compression – Unnecessary bloat from repetitive headers.
  • Waterfall requests – Browsers can‘t discover assets until HTML is downloaded.

Workarounds like spritesheets, inlining, sharding, and pipelining helped, but reached their limits. Developers longing for a new foundation led to…

The Promise of HTTP/2

After years of prototypes, the IETF standardized HTTP/2 in 2015 based heavily on Google‘s SPDY protocol. I eagerly watched its development, knowing it would be a game changer.

The timing coincided nicely with WordPress‘ continued growth. While WordPress now powers over 40% of all websites, many still run on aging HTTP/1.1 infrastructure.

HTTP/2 provides crucial improvements:

  • Multiplexing – Requests are interleaved on one connection avoiding head of line blocking.
  • Server Push – Servers can preemptively send assets without waiting for requests.
  • Header Compression – Common headers are encoded to save bandwidth.
  • TLS Encryption – Enabled by default for security.
  • Stream Prioritization – Browsers can signal preferred resource ordering.

But does it really provide a performance boost? The numbers speak for themselves:

{{Image: http2-vs-http1.png | Comparison of page load time metrics for HTTP/1.1 vs HTTP/2 demonstrating significant performance gains with HTTP/2 across metrics like TTFB, DOM interactive, and page complete.}}

In controlled testing, HTTP/2 achieved gains of 15-18% on average compared to HTTP/1.1. Real world results have been similar:

{{Image: http2-case-studies.png | Table showing improvements in page load times, bandwidth reduction, and other metrics reported by various companies after switching to HTTP/2. Mozilla saw 31% faster page loads.}}

For WordPress sites struggling under bloated plugins, insecure legacy code, and technical debt, HTTP/2 is a lifeline.

Adoption is skyrocketing, with over 50% of all websites now supporting HTTP/2:

{{Image: http2-adoption-chart.png | Graph of HTTP/2 usage over time showing rapid growth since 2016. It is now used by over 50% of all websites.}}

Clearly, HTTP/2 is ready for mainstream use. But what steps should you take to enable it for your WordPress site?

Preparing Your WordPress Site for HTTP/2

Migrating to HTTP/2 is a straightforward process, but does require some preparation:

Install an SSL Certificate

HTTP/2 only works over a secure HTTPS connection. So the first step is installing an SSL certificate and switching your site to use HTTPS URLs exclusively.

If your host doesn‘t provide one, you can get a free SSL certificate from Let‘s Encrypt. Paid certificates are affordable too starting around $60 per year.

For details, see our guide on how to install an SSL certificate in WordPress.

Update Your Server Software

Your server stack needs to support HTTP/2. Most managed WordPress hosts stay current, but check yours to be sure.

For self-hosted sites, you‘ll need:

  • Apache 2.4.17+
  • Nginx 1.9.5+
  • IIS 10+ on Windows Server 2016+

If needed, contact your host about upgrading. Or, upgrade yourself if you have root access.

Enable HTTPS Strict Transport Security

To ensure visitors only connect over HTTPS, enable HSTS in your .htaccess file:

<IfModule mod_headers.c>  
  Header always set Strict-Transport-Security "max-age=31536000"
</IfModule>

Redirect HTTP to HTTPS

Use 301 permanent redirects to forward all HTTP requests to HTTPS:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTPS} !=on
  RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 
</IfModule>

These steps don‘t require any WordPress changes. At this point your site accepts HTTPS connections exclusively. Now we‘re ready to verify HTTP/2 support.

Testing Your WordPress Site for HTTP/2

With prerequisites in place, verifying HTTP/2 is working takes just a few minutes.

Your options:

1. Use an HTTP/2 Testing Tool

Free websites like https://http2.pro allow you to test if your server supports HTTP/2.

Just enter your URL and it will analyze the response headers looking for the h2 protocol:

{{Image: http2-test-tool.png | Example showing positive HTTP/2 test results at HTTP2.pro.}}

2. Check in Browser Developer Tools

Most modern browsers include developer tools that surface connection info.

In Chrome, open the Network tab and reload your page. Look for h2 under the Protocol column:

{{Image: chrome-dev-tools-http2.png | Screenshot demonstrating how to view HTTP/2 requests in Chrome‘s network tab. Several requests show h2 protocol.}}

Firefox, Edge, and Safari also provide visibility into HTTP/2 activity.

3. Use nghttp2 CLI Tool

For more control, install the nghttp2 command line tool and run:

nghttp -nv https://yourdomain.com

This will inspect the raw HTTP traffic and highlight HTTP/2 negotiation.

No matter how you test, validating HTTP/2 is active ensures your site performs optimally for visitors.

Now let‘s look at further optimizing your page speed leveraging HTTP/2 capabilities.

Complementary Performance Optimizations

While HTTP/2 resolves protocol-level bottlenecks, real world site speed also depends on your WordPress hosting, CDN, caching, and content optimizations.

A few tips:

  • Upgrade to a performance-focused WordPress host – Platforms like WP Engine excel at scaling HTTP/2 for high traffic sites.

  • Enable Caching – Leverage browser caching and a page cache like wpCache to minimize requests.

  • Utilize a CDN – Distribute static assets globally. This complements HTTP/2 perfectly.

  • Optimize Images – Compress images and serve responsive formats to improve payload transfer.

  • Minify Resources – Streamline CSS, JS, and HTML files sizes via minification.

  • Handle JS and CSS Delivery – Bundle, defer loading, and potentially serve from cookieless domain.

  • Adopt Lazy Loading – Only load below the fold images and embeds when needed.

With HTTP/2 eliminating protocol friction, you can now optimize performance at the edge and application layers.

Reaping the Benefits of HTTP/2 for Your WordPress Site

After helping hundreds of WordPress sites upgrade to HTTP/2, I can definitively say it delivers tremendous performance improvements.

Faster page loads directly correlate to higher conversion rates, lower bounce rates, and improved engagement.

While HTTP/2 is a backend change users may not notice, they‘ll appreciate the speed boost. Pages just feel snappier!

To quickly recap, here are the steps to enable HTTP/2 for your WordPress site:

  1. Install an SSL certificate and switch to HTTPS.
  2. Update your server to support HTTP/2 if needed.
  3. Use redirects and HSTS for HTTPS exclusivity.
  4. Validate HTTP/2 functionality with online tools.
  5. Consider complementary performance optimizations.

For most managed WordPress hosts, this is as simple as contacting support and flipping the switch.

Self-hosted sites may require more effort, but the benefits are well worth it. HTTP/2 has rightly been called the biggest advancement to web infrastructure in 15 years!

If you have any questions about upgrading to HTTP/2, feel free to reach out and I‘m happy to provide guidance from an expert standpoint. The future is looking bright and fast!

Written by Jason Striegel

C/C++, Java, Python, Linux developer for 18 years, A-Tech enthusiast love to share some useful tech hacks.