Cookies are small bits of data that a website stores on your web browser so that it can recognize you should you visit again. Some websites you re-visit have your preferences or settings adjusted the same way as you had left them — that’s what cookies do.When unnecessary cookies are stored on your browser, things start to get slow. Cookies that have no purpose get collected on your browser, and the website has to contend with all of them before it loads, slowing down your loading speed.
With dynamic content — content that has to be created and tailored to your need — there is no choice but to use cookies. Static content, on the other hand, is content that stays the same regardless of who visits it (an ‘About Us’ page, for example).So, with a cookie-free domain, you can serve static content without the overhead of cookies. The usual way to set this up is to create a sub-domain. For example, if a website has the domain name ‘www.webstore.com’ then a subdomain could be ‘blog.webstore.com’.
The way to create a cookie-free domain is to make a subdomain that serves only the static content.Go over to the ‘Domains’ menu. In the top field write the name of the subdomain, and below that the name of the top domain. Below these two fields is the Document Root — enter the ‘wp-content’ directory here.
Once the above step is done, set up WordPress so that it knows to serve static content via the new subdomain.From the main menu, go to the ‘Files’ category and click on ‘File Manager’. Click on the ‘wp-config.php’ file and then choose ‘Edit’.Thereafter, enter these directives in the file:
The above process will create the subdomain and direct WordPress to serve the static content from it. However, this will not migrate existing static content to the new subdomain — for that, there is an additional step via phpMyAdmin. What we discussed above should be sufficient for creating a cookie-free domain and setting it up to work.