{"id":2644,"date":"2017-03-04T17:01:12","date_gmt":"2017-03-04T17:01:12","guid":{"rendered":"https:\/\/ampforwp.com\/?p=2644"},"modified":"2019-06-25T09:33:53","modified_gmt":"2019-06-25T09:33:53","slug":"host-disqus-comments","status":"publish","type":"ht_kb","link":"https:\/\/ampforwp.com\/tutorials\/article\/host-disqus-comments\/","title":{"rendered":"How to Host Disqus Comments on your own servers in AMP for WP"},"content":{"rendered":"<p>The goal of this tutorial is to modify the https server, which presently is set to our secure API, but if you follow this tutorial, you will be able to host it through your domain.<\/p>\n<p><strong>Please follow the following steps:<\/strong><\/p>\n<p><span style=\"color: #800000;\"><strong>1.<\/strong><\/span> Switch off the option that is highlighted in the below screenshot, that will turn off the hosting from our secure API to your website.<\/p>\n<p><span style=\"color: #800000;\"><strong>2.<\/strong><\/span> You will find this option in <strong>AMP option panel<\/strong> -&gt; <strong>Settings<\/strong> -&gt; <strong>Comments<\/strong> -&gt; <strong>Enable Disqus option.<\/strong><\/p>\n<p><a href=\"https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2017\/03\/disqus-1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-10586\" src=\"https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2017\/03\/disqus-1.png\" alt=\"\" width=\"1320\" height=\"626\" srcset=\"https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2017\/03\/disqus-1.png 1320w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2017\/03\/disqus-1-300x142.png 300w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2017\/03\/disqus-1-768x364.png 768w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2017\/03\/disqus-1-1024x486.png 1024w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2017\/03\/disqus-1-50x24.png 50w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2017\/03\/disqus-1-60x28.png 60w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2017\/03\/disqus-1-100x47.png 100w\" sizes=\"(max-width: 1320px) 100vw, 1320px\" \/><\/a><\/p>\n<p><strong>3.<\/strong> Now let&#8217;s create a new host file from your HTTPS server. You will be presented with this option to enter your host file URL(which should be over HTTPS server).<\/p>\n<p>For that, you need to create a subdomain on your website which you can do it from your Cpanel and you need to make sure that the subdomain also has the https installed.<\/p>\n<p>Once you have both setups, you need to create a new file in that subdomain folder with the name &#8220;disqus.php&#8221;. In that file, you need to place some code that is required by the Disqus, which you can find in the below gist.<\/p>\n<p><script src=\"https:\/\/gist.github.com\/khaledMohammed000\/ac243d77a880bd7d87083e330444c3f4.js\"><\/script><\/p>\n<p>Once you have created and added the code, then you must upload that to the server and now you will have a URL like: https:\/\/comments.example.com\/disqus.php. If you are trying to open that URL and it return the blank screen then don&#8217;t panic. Just proceed with the article.<\/p>\n<p>Then\u00a0go to the options and paste that URL into the field with the name &#8220;Disqus Host File&#8221; like the below screenshot.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-2649\" src=\"https:\/\/ampforwp.com\/wp-content\/uploads\/2017\/02\/Accelerated-Mobile-Pages-Options-\u2039-Test-Site-Title-\u2014-WordPress-Google-Chrome-2017-02-03-11.40.28.png\" alt=\"Disqus host file\" width=\"701\" height=\"95\" \/><\/p>\n<p>Now, check your website article, it should have the Disqus comments installed.<\/p>\n<p><strong>Links to more resources for Disqus:<\/strong><\/p>\n<p><a href=\"https:\/\/labs.tomasino.org\/disqus-in-amp\/\">Disqus in AMP<\/a> by Tomasino Labs<\/p>\n<p><a href=\"https:\/\/github.com\/disqus\/disqus-install-examples\/tree\/master\/google-amp\">Disqus installation<\/a> by Official AMP Project<\/p>\n<p><a href=\"https:\/\/blog.disqus.com\/disqus-now-compatible-with-google-amp\">Disqus Blog post<\/a> by Disqus.com<\/p>\n<p><strong>Back to you<\/strong><\/p>\n<p>I really hope it helps you. Let us know your thoughts\u00a0in the comments below.<\/p>\n<p><strong>That\u2019s it for this tutorial!<\/strong><\/p>\n<p>We hope it helped you. If you have any feedback or questions, then please share them in the comments section below.<\/p>\n<div id=\"div-1\" class=\"hkb-feedback\">\n\t\t\t<strong class=\"ht-mobile-exit__title\">Ask your Questions Directly!<\/strong><br>\n\t\t\t<div class=\"hkb_widget_exit__content\" style=\"font-size: 14px;\">If you can't find the solutions in this article, then just ask us in the comments and we will answer it for you!<\/div>\n\t\t\t<a href=\"https:\/\/ampforwp.com\/support\/#contact\" id=\"button\" target=\"_blank\" rel=\"noopener noreferrer\"><button>Yes, I have a Question<\/button><\/a>\n\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>The goal of this tutorial is to modify the https server, which presently is set to our secure API, but if you follow this tutorial, you will be able to host it through your domain. Please follow the following steps: 1. Switch off the option that is highlighted in the&#8230;<\/p>\n","protected":false},"author":1,"comment_status":"open","ping_status":"open","template":"","format":"standard","meta":[],"ht-kb-category":[34],"ht-kb-tag":[],"_links":{"self":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/2644"}],"collection":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/comments?post=2644"}],"version-history":[{"count":5,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/2644\/revisions"}],"predecessor-version":[{"id":11586,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/2644\/revisions\/11586"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/3484"}],"wp:attachment":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/media?parent=2644"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb-category?post=2644"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb-tag?post=2644"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}