why to Use cookie-free domains

How to set-up Cookie-Free Domains

What is cookie free domains? How to use Cookie-Free Domains?

A domain that serves no cookies is called cookie free domain. Cookie Free domains is a separate domain which will not serve cookie and boost up your website speed.You can create sub domain for serving a static content such as; HTML, CSS, Images, Java-Script, Icon file etc. So, when browser load content from the separate cookie free domain, it will not send cookie data and users don’t waste time and bandwidth transmitting cookies for them.

Why is Cookie-Free Domains Important?

When you use cookie-free domains on your website, you are able to separate the content that doesn’t require cookies from the content that does. This helps in improving your website’s performance by elimination unnecessary network traffic.

How to set up Cookie-Free Domains

If you set your cookies on a top-level domain (e.g. yourwebsite.com) you can create another subdomain (e.g. static.yourwebsite.com) to host all of your static files which will no longer result in any cookies being sent. The idea behind this is that all your static cookies will be now host in your subdomain.

Follow the simple steps below to set up cookie-free domains

1. Create a subdomain such as static.yourwebsite.com or cookie.yoursite.com
2. Point your new subdomain to the /wp-content directory of your WordPress installationHow to point

How to point sub-domain to the wp-content directory

a. Login to your cPanel
b. Click Subdomains

Use cookie-free domains

Use cookie-free domains : Click Subdomain

c. Click the Edit icon

How to Use cookie-free domains in wordpress

Click Edit Icon

d. Now, write /wp-content after the public_html (there should be no space)

Point subdomain to the wp-content directory

Point subdomain to the /wp-content directory

e. Click Change

3. Now, Open your wp-config.php file of WordPress and add the following line of code into it.

define("WP_CONTENT_URL", "http://static.yourwebsite.com"); 
define("COOKIE_DOMAIN", "www.yourwebsite.com");

Now test your site using : GTmetrix.com

Also Read : 3 best WordPress plugin to optimize and compress images

Suanlian Tangpua
Follow him

Suanlian Tangpua

Suanlian Tangpua is a Graphic & Website Designer based in New Delhi. He loves photography, cooking and blogging. Feel free to contact him at [email protected]
Suanlian Tangpua
Follow him