{"id":4058,"date":"2020-12-24T21:59:42","date_gmt":"2020-12-24T21:59:42","guid":{"rendered":"https:\/\/chemicloud.com\/kb\/?post_type=ht_kb&#038;p=4058"},"modified":"2024-10-16T09:39:09","modified_gmt":"2024-10-16T09:39:09","slug":"cookie-free-domains-in-wordpress","status":"publish","type":"ht_kb","link":"https:\/\/chemicloud.com\/kb\/article\/cookie-free-domains-in-wordpress\/","title":{"rendered":"How To Setup Cookie-Free Domains in WordPress"},"content":{"rendered":"<p>If you have ever used a site like <a href=\"https:\/\/chemicloud.com\/blog\/gtmetrix-speed-test-tool\/\" target=\"_blank\" rel=\"noopener\"><strong>GTMetrix<\/strong><\/a> to analyze the performance and optimizations on your website, you&#8217;ve probably seen a suggestion that you Use <strong>cookie-free domains<\/strong>. When you click a link in Chrome, it sends a request to a URL for that data along with some response headers. Inside of those response headers may be instructions for your browser to set a cookie. These can be used for various things, like tracking, sessions (like in a shopping cart), comments, and more.<\/p>\n<h2 id=\"what-are-a-cookie-free-domains\"><strong>What Are a Cookie-Free Domains?<\/strong><\/h2>\n<p>A cookie free domain, on the other hand, is a domain that doesn&#8217;t send a command to your browser to store cookies. Think about the content on your website. Of everything on the site, how much of it needs to interact with a user in a way that your browser would need to remember them? Probably not a lot of it. This means you can shift your static assets, like CSS files, images, and video to a different sub-domain to reduce the load time on the main website. It makes your website a little bit faster. Pretty neat trick, right?<\/p>\n<h2 id=\"how-to-setup-cookie-free-domains-in-wordpress\">How To Setup Cookie-Free Domains in WordPress<\/h2>\n<p><strong>Step 1:<\/strong> Login to your cPanel. There&#8217;s a lot of ways to do this, but the sure fire easiest way is to login to your <a href=\"https:\/\/lab.chemicloud.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Client Area<\/a>, then open your cPanel.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4061\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/lab.jpg\" alt=\"\" width=\"1674\" height=\"496\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/lab.jpg 1674w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/lab-300x89.jpg 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/lab-1024x303.jpg 1024w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/lab-768x228.jpg 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/lab-50x15.jpg 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/lab-1536x455.jpg 1536w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/lab-60x18.jpg 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/lab-100x30.jpg 100w\" sizes=\"auto, (max-width: 1674px) 100vw, 1674px\" \/><\/p>\n<p><strong>Step 2:<\/strong> Navigate to the Domains area and click Subdomains.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4062\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/subdomains.jpg\" alt=\"\" width=\"1917\" height=\"382\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/subdomains.jpg 1917w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/subdomains-300x60.jpg 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/subdomains-1024x204.jpg 1024w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/subdomains-768x153.jpg 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/subdomains-50x10.jpg 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/subdomains-1536x306.jpg 1536w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/subdomains-60x12.jpg 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/subdomains-100x20.jpg 100w\" sizes=\"auto, (max-width: 1917px) 100vw, 1917px\" \/><\/p>\n<p><strong>Step 3:<\/strong> To have your static content, such as CSS Stylesheets, Images, and Videos served on a subdomain, you&#8217;ll need to create the subdomain first. In this case, we&#8217;re going to call our subdomain &#8216;static&#8217;, without the quotes around it.<\/p>\n<p>You also need to point it to the directory where your WordPress content is stored. You can do this while creating the subdomain.<\/p>\n<p>First, give the subdomain your name.<br \/>\nSecond, ensure the domain for which you are creating the subdomain matches.<br \/>\nThird, in the directory path where your WordPress installation is installed.<\/p>\n<p>For example, my WordPress installation is in my public_html, then inside of a folder called cookiefree. And by default, the wp-content folder is where WordPress stores content. This means the directory path is \/public_html\/cookiefree\/wp-content. As shown below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4064\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/createsubdomain.jpg\" alt=\"\" width=\"1045\" height=\"500\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/createsubdomain.jpg 1045w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/createsubdomain-300x144.jpg 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/createsubdomain-1024x490.jpg 1024w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/createsubdomain-768x367.jpg 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/createsubdomain-50x24.jpg 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/createsubdomain-60x29.jpg 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/createsubdomain-100x48.jpg 100w\" sizes=\"auto, (max-width: 1045px) 100vw, 1045px\" \/><\/p>\n<p>If you installed your WordPress into the root of your public_html folder, then your directory path (for example) would be:<\/p>\n<pre>\/public_html\/wp-content<\/pre>\n<p><strong>Step 4:<\/strong> Now you need to update your wp-config file and tell it where to look for the files inside the wp-content folder. To do this, return to your cPanel and in the Files area, open the File Manager.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4065\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/files.jpg\" alt=\"\" width=\"1427\" height=\"530\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/files.jpg 1427w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/files-300x111.jpg 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/files-1024x380.jpg 1024w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/files-768x285.jpg 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/files-50x19.jpg 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/files-60x22.jpg 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/files-100x37.jpg 100w\" sizes=\"auto, (max-width: 1427px) 100vw, 1427px\" \/><\/p>\n<p>Once the file manager opens, navigate to the directory where your WordPress configuration is installed.<\/p>\n    \t\t<div class=\"hts-messages hts-messages--info  hts-messages--withtitle hts-messages--withicon \"   >\r\n    \t\t\t<span class=\"hts-messages__title\">Important Tip:<\/span>    \t\t\t    \t\t\t\t<p>\r\n    \t\t\t\t\tBe sure to click the icons to the left of the folders you wish to open, otherwise you will be given the option to rename them and their text will turn blue. Should this happen, no worries, just click in the whitespace anywhere on the page to exit the edit mode and try again.\u00a0    \t\t\t\t<\/p>\r\n    \t\t\t    \t\t\t\r\n    \t\t<\/div><!-- \/.ht-shortcodes-messages -->\r\n    \t\t\n<p>Once you have reached the folder in which your WordPress installation resides, look for the wp-config.php file and click it once to highlight\/select the file.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4066\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/selectwpconfig.jpg\" alt=\"\" width=\"1918\" height=\"1288\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/selectwpconfig.jpg 1918w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/selectwpconfig-300x201.jpg 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/selectwpconfig-1024x688.jpg 1024w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/selectwpconfig-768x516.jpg 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/selectwpconfig-50x34.jpg 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/selectwpconfig-1536x1031.jpg 1536w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/selectwpconfig-60x40.jpg 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/selectwpconfig-100x67.jpg 100w\" sizes=\"auto, (max-width: 1918px) 100vw, 1918px\" \/><\/p>\n<p>Next, click the Edit icon at the top of the cPanel File Manager.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4067\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/fmangeredit.jpg\" alt=\"\" width=\"1918\" height=\"1288\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/fmangeredit.jpg 1918w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/fmangeredit-300x201.jpg 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/fmangeredit-1024x688.jpg 1024w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/fmangeredit-768x516.jpg 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/fmangeredit-50x34.jpg 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/fmangeredit-1536x1031.jpg 1536w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/fmangeredit-60x40.jpg 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/fmangeredit-100x67.jpg 100w\" sizes=\"auto, (max-width: 1918px) 100vw, 1918px\" \/><\/p>\n<p>You will see a warning like the one below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4068\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/warningedit.jpg\" alt=\"\" width=\"397\" height=\"274\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/warningedit.jpg 739w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/warningedit-300x207.jpg 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/warningedit-50x35.jpg 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/warningedit-60x41.jpg 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/warningedit-100x69.jpg 100w\" sizes=\"auto, (max-width: 397px) 100vw, 397px\" \/><\/p>\n<p>95% of users can proceed and click Edit.<\/p>\n    \t\t<div class=\"hts-messages hts-messages--alert  hts-messages--withtitle hts-messages--withicon \"   >\r\n    \t\t\t<span class=\"hts-messages__title\">What if I'm in that 5% of users who can't click edit?<\/span>    \t\t\t    \t\t\t\t<p>\r\n    \t\t\t\t\tContact our support and let them know you installed your WordPress installation using a utf format other than utf-8 and we can help you out! Your native language, or at least the language you installed WordPress, probably isn&#8217;t based on the Roman Alphabet. \ud83d\ude09 Not to worry, we are all international here and can get you sorted!     \t\t\t\t<\/p>\r\n    \t\t\t    \t\t\t\r\n    \t\t<\/div><!-- \/.ht-shortcodes-messages -->\r\n    \t\t\n<p>A new tab in your browser will spawn, and you will see the codebase that outlines the structure of your wp-config file. Don&#8217;t worry if this seems overwhelming; we&#8217;re only adding two lines to this file, not editing anything else.<\/p>\n<p>Scroll down to the bottom of the file and paste these two lines of code in:<\/p>\n<pre>define(\u201cWP_CONTENT_URL\u201d, \u201cstatic.yourwebsite.com\u201d);\r\ndefine(\u201cCOOKIE_DOMAIN\u201d, \u201cwww.yourwebsite.com\u201d);<\/pre>\n<p>Be sure to replace &#8216;static&#8217; with the name of your subdomain and &#8216;yourwebsite.com&#8217; with your domain name and corresponding TLD.<\/p>\n<p>Your entry should look similar to the one below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4070\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/endofwpconfig.jpg\" alt=\"\" width=\"1060\" height=\"338\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/endofwpconfig.jpg 1060w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/endofwpconfig-300x96.jpg 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/endofwpconfig-1024x327.jpg 1024w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/endofwpconfig-768x245.jpg 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/endofwpconfig-50x16.jpg 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/endofwpconfig-60x19.jpg 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/endofwpconfig-100x32.jpg 100w\" sizes=\"auto, (max-width: 1060px) 100vw, 1060px\" \/><\/p>\n<p>Now you need to save your changes. To do this, click the blue Save Changes button in the top right corner of the Editor window.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4071\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/save.jpg\" alt=\"\" width=\"330\" height=\"230\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/save.jpg 518w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/save-300x209.jpg 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/save-50x35.jpg 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/save-60x42.jpg 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/save-100x70.jpg 100w\" sizes=\"auto, (max-width: 330px) 100vw, 330px\" \/><\/p>\n<p><strong>Step 5:<\/strong> This step is semi-optional.<\/p>\n<p>If you have just installed WordPress and your site doesn&#8217;t have any content in it, i.e. Posts or Pages, you can skip this step. You can close your cPanel and the File Manager and continue on your way to creating your website in WordPress! <strong>Huzzah!\u00a0<\/strong><\/p>\n<p class=\"p1\"><b>Tired of slow WordPress hosting? We use LiteSpeed + QUIC.cloud Enterprise CDN to deliver content almost instantly. <\/b><span class=\"s1\">\u26a1<\/span><b> Try our <\/b><a href=\"https:\/\/chemicloud.com\/managed-wordpress-hosting?utm_source=kb&amp;utm_medium=article#60b65e4e63b58\"><b>Managed WordPress Hosting<\/b><\/a><b> plans for just $1!<\/b><\/p>\n<p>If your site does have content in it, please follow the steps below.<\/p>\n<p>Next, return to the browser tab in which the File Editor is open with the wp-config file still open. Look midway (approximately) through the file for a section called * WordPress Database Table prefix&#8221; and note the table prefix that is listed in the line below. In my example, the table prefix is as follows:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4072\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/prefix.jpg\" alt=\"\" width=\"846\" height=\"187\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/prefix.jpg 846w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/prefix-300x66.jpg 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/prefix-768x170.jpg 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/prefix-50x11.jpg 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/prefix-60x13.jpg 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/prefix-100x22.jpg 100w\" sizes=\"auto, (max-width: 846px) 100vw, 846px\" \/><\/p>\n<p>Please make a note of this prefix because you&#8217;ll need it for Step 6!<\/p>\n<p><strong>Step 6:<\/strong> Because you already have content in your WordPress site but are now using a subdomain to serve your static content, you&#8217;ll need to update the database table to instruct WordPress of this change.<\/p>\n<p>Now, the change you need to make is to use a tool called phpMyAdmin, which is located in your cPanel. phpMyAdmin is a great tool but can be dangerous if misused. It&#8217;s essential you follow the instructions below carefully so you don&#8217;t damage your WordPress Site by mistake.<\/p>\n<p>First, take a backup of your website. It&#8217;s always essential to make a backup of your site before making changes to the database in WordPress. You can use your preferred method for this, such as using Softaculous or JetBackups.<\/p>\n<p>After you&#8217;ve made your backup, return to the browser with the File Manager Editor open. If you&#8217;ve taken note of your Database Table Prefix, as mentioned above, you can close the editor by clicking the Close button in the top right corner. This will return you to the File Manager. You can also close this tab in your browser.<\/p>\n<p>Now, you should have your cPanel open. Navigate to the Databases area and click the phpMyAdmin option to open the application.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4073\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin1.jpg\" alt=\"\" width=\"1427\" height=\"294\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin1.jpg 1427w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin1-300x62.jpg 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin1-1024x211.jpg 1024w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin1-768x158.jpg 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin1-50x10.jpg 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin1-60x12.jpg 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin1-100x21.jpg 100w\" sizes=\"auto, (max-width: 1427px) 100vw, 1427px\" \/><\/p>\n<p>Your phpMyAdmin should look something like this when opened:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4074\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin2.jpg\" alt=\"\" width=\"1918\" height=\"990\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin2.jpg 1918w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin2-300x155.jpg 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin2-1024x529.jpg 1024w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin2-768x396.jpg 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin2-50x26.jpg 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin2-1536x793.jpg 1536w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin2-60x31.jpg 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin2-100x52.jpg 100w\" sizes=\"auto, (max-width: 1918px) 100vw, 1918px\" \/><\/p>\n<p>Let&#8217;s examine the layout of this real quick. On the left side, we have a list of your databases. If you expand the database by clicking the + next to it, you can see a list of all the tables in the database.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4077\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin3-1.jpg\" alt=\"\" width=\"847\" height=\"647\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin3-1.jpg 847w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin3-1-300x229.jpg 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin3-1-768x587.jpg 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin3-1-50x38.jpg 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin3-1-60x46.jpg 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin3-1-100x76.jpg 100w\" sizes=\"auto, (max-width: 847px) 100vw, 847px\" \/><\/p>\n<p>Since you have content in your database, as you have existing posts and pages, we will be modifying the posts table, which is prefixed for my installation by wpbn_.<\/p>\n<p>The prefix of your database will 100% be different than mine. Mine was randomly named as part of the Softaculous installation process. It was essential to notate your database prefix earlier while you had your wp-config file opened. However, you can also get the prefix by opening phpMyAdmin, as you see.<\/p>\n<p>Next, we need to run a command inside of phpMyAdmin. However, we need to select the table in which we want to run this command first. To do that, click the _posts table with your mouse.<\/p>\n<p>Your phpMyAdmin will open the _posts table. You can tell you have your posts table open because at the top of phpMyAdmin, it will indicate to you the Database and Table you&#8217;re presently using:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4078\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin4.jpg\" alt=\"\" width=\"1918\" height=\"1115\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin4.jpg 1918w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin4-300x174.jpg 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin4-1024x595.jpg 1024w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin4-768x446.jpg 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin4-50x29.jpg 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin4-1536x893.jpg 1536w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin4-60x35.jpg 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin4-100x58.jpg 100w\" sizes=\"auto, (max-width: 1918px) 100vw, 1918px\" \/><\/p>\n<p>Also, on the left, you will see a grey selection covering the table you&#8217;re editing!<\/p>\n<p>Next, click the SQL tab at the top of the page.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4079\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin5.jpg\" alt=\"\" width=\"1918\" height=\"721\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin5.jpg 1918w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin5-300x113.jpg 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin5-1024x385.jpg 1024w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin5-768x289.jpg 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin5-50x19.jpg 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin5-1536x577.jpg 1536w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin5-60x23.jpg 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin5-100x38.jpg 100w\" sizes=\"auto, (max-width: 1918px) 100vw, 1918px\" \/><\/p>\n<p>When the page opens, you may see some text in the text box, just like in the image above. Simply click into this text box, and using the backspace key on your keyboard, delete the text until there&#8217;s nothing there except the 1 to the left of the text box.<\/p>\n<p>We need to paste a command instructing WordPress that you&#8217;ve decided to use a subdomain for all of your static content. This command is below:<\/p>\n<div class=\"steps\">\n<ol class=\"steps__list\">\n<li class=\"steps__list-item\">\n<pre class=\" language-none\"><code class=\" language-none\">UPDATE wp_posts SET post_content = REPLACE(post_content,'www.yourwebsite.com\/wp-content\/','static.yourwebsite.com\/')<\/code><\/pre>\n<\/li>\n<\/ol>\n<\/div>\n<p>Since you&#8217;ll need to customize this command a bit, let&#8217;s break down what this command does.<\/p>\n<p>UPDATE wp_posts tells phpMyAdmin we are executing an UPDATE command on the table called wp_posts<\/p>\n<p>SET post_content = REPLACE (post_content,&#8217;www.yourwebsite.com\/wp-content&#8217;,&#8217;static.yourwebsite.com\/&#8217;) tells phpMyAdmin we are making changes to the row post_content and the change we are making is changing the URL.<\/p>\n<p>It is VERY important you update the command with the corresponding table prefix from your phpMyAdmin. For example, to run this command on my WordPress installation, the command would look like this:<\/p>\n<div class=\"steps\">\n<ol class=\"steps__list\">\n<li class=\"steps__list-item\">\n<pre class=\" language-none\"><code class=\" language-none\">UPDATE wpbn_posts SET post_content = REPLACE(post_content,'www.cchostingdemos.com\/wp-content\/','static.cchostingdemos.com\/')<\/code><\/pre>\n<\/li>\n<\/ol>\n<\/div>\n<p>When pasted into phpMyAdmin, it looks like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4080\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin6.jpg\" alt=\"\" width=\"1918\" height=\"730\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin6.jpg 1918w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin6-300x114.jpg 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin6-1024x390.jpg 1024w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin6-768x292.jpg 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin6-50x19.jpg 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin6-1536x585.jpg 1536w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin6-60x23.jpg 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin6-100x38.jpg 100w\" sizes=\"auto, (max-width: 1918px) 100vw, 1918px\" \/><\/p>\n<p>After pasting your query into the box (modified with your table prefix and domain name) you can simulate the query by clicking the Simulate Query button in the bottom right. This will present to you simulated results to ensure the query runs without issue. Or, if you&#8217;re ready to execute the command, just click Go.<\/p>\n<p>Your phpMyAdmin page will look similar to the one below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4081\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin7.jpg\" alt=\"\" width=\"1918\" height=\"283\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin7.jpg 1918w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin7-300x44.jpg 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin7-1024x151.jpg 1024w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin7-768x113.jpg 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin7-50x7.jpg 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin7-1536x227.jpg 1536w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin7-60x9.jpg 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/phpmyadmin7-100x15.jpg 100w\" sizes=\"auto, (max-width: 1918px) 100vw, 1918px\" \/><\/p>\n    \t\t<div class=\"hts-messages hts-messages--info  hts-messages--withtitle hts-messages--withicon \"   >\r\n    \t\t\t<span class=\"hts-messages__title\">Pro-Tip:<\/span>    \t\t\t    \t\t\t\t<p>\r\n    \t\t\t\t\tIf you experience an error, check your SQL query (the line of code you pasted in with your table prefix and domain name) and ensure everything matches and you have no extra spaces at the end or in-between the command. If you still have troubles, let our Happiness Engineers know by coming into live chat or opening a ticket from your Client Area, and we can help get you sorted!\u00a0    \t\t\t\t<\/p>\r\n    \t\t\t    \t\t\t\r\n    \t\t<\/div><!-- \/.ht-shortcodes-messages -->\r\n    \t\t\n<p>Once the command has run successfully, that&#8217;s all you need to do! Your database will be updated to serve static content from your new static subdomain and your site should appear to be noticeably faster!<\/p>\n<p>We hope you enjoyed this KB article. If you did, you&#8217;d enjoy our hosting even more!<\/p>\n<p class=\"p1\">Check out our <a href=\"https:\/\/chemicloud.com\/managed-wordpress-hosting?utm_source=blog&amp;utm_medium=article#60b65e4e63b58\"><span class=\"s1\">Managed WordPress hosting<\/span><\/a>\u00a0plans and have your website migrated today!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you have ever used a site like GTMetrix to analyze the performance and optimizations on your website, you&#8217;ve probably seen a suggestion that you Use cookie-free domains. When you click a link in Chrome, it sends a request to a URL for that data along with some response headers&#8230;.<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"ht-kb-category":[40],"ht-kb-tag":[],"class_list":["post-4058","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-wordpress"],"_links":{"self":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/4058","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/comments?post=4058"}],"version-history":[{"count":8,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/4058\/revisions"}],"predecessor-version":[{"id":8495,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/4058\/revisions\/8495"}],"wp:attachment":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/media?parent=4058"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb-category?post=4058"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb-tag?post=4058"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}