When working on clients’ sites, I often see that many use www.domain.com for WordPress Address and Site Address (you’ll find these settings in your WP Admin Dashboard under Settings>General). However, most people never type in www when visiting our sites. And if that’s the case, then they get redirected from domain.com (called naked domain) to www.domain.com. Depending on your Domain Name Server and your server response time, this redirect can take tens or hundreds of milliseconds and I’ve seen it increase loading time by as much as a second or two on some servers.
You can speed up your WordPress site by removing this 301 redirect. To do that, we need to change our setup in WP Admin and change DNS records accordingly.
If you’re a WordPress Speed Secrets member and using CloudFlare, here’s an example of what your DNS records should look like. Your A record is your naked domain pointing to your server IP address. Your www subdomain is a CNAME as an alias of the naked domain. This way all your traffic is directed to your naked domain, regardless of how they type in your site URL. There are no redirects and your site loads faster.
To make this work, you’ll also need to change WordPress Address and Site Address in WP Admin Dashboard from www to naked domain and make sure there is no 301 redirect in your .htaccess. If you’re using your host’s DNS, look at DNS records and change them accordingly.
Important: If your site has been around for a while, check your backlinks in Google Search Console (formerly Google Developer Tools). If they are bringing visitors to the www subdomain, your visitors will land on your site just fine but you may want to consider SEO consequences and based on the number of backlinks decide what is more important in your particular case as there is no rule of thumb here.
That’s how you speed up your WordPress site by removing unnecessary redirects. And if you’d like to get your site blazing fast in under 2 hours, sign up for my WordPress Speed Secrets video tutorial. Cheers!
Was this article useful? If so, please share it.