{"id":28893,"date":"2012-08-17T23:12:43","date_gmt":"2012-08-17T17:42:43","guid":{"rendered":"https:\/\/www.quickonlinetips.com\/archives\/?p=28893"},"modified":"2020-05-24T10:59:10","modified_gmt":"2020-05-24T05:29:10","slug":"wordpress-disqus-import-export-comments-errors","status":"publish","type":"post","link":"https:\/\/www.quickonlinetips.com\/archives\/2012\/08\/wordpress-disqus-import-export-comments-errors\/","title":{"rendered":"How to Fix WordPress Export, Disqus Import Comments Errors"},"content":{"rendered":"<p>Want to fix WordPress export comments errors, and problems in Disqus import? Are you unable to replace Disqus Comments with your WordPress comments? We switched <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2012\/08\/wordpress-disqus-comments\/\">WordPress Comments to Disqus comments<\/a>, which are live right now and would like to share with you some errors which we fixed along the way. The purpose of this post is that if you have experienced similar errors, these tips should help you fix it.<\/p>\n<p>First you need to install the <a href=\"https:\/\/wordpress.org\/plugins\/disqus-comment-system\/\" target=\"_blank\" rel=\"noopener noreferrer\">Disqus Plugin<\/a>. You need to simply export your WordPress comments to Disqus comments, and it will sync automatically later between the two commenting systems.<\/p>\n<h3>WordPress Comments Export Errors<\/h3>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-28933\" title=\"disqus-export-error\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/disqus-export-error.png\" alt=\"disqus export error\" width=\"500\" height=\"132\" border=\"1\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/disqus-export-error.png 500w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/disqus-export-error-150x39.png 150w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/disqus-export-error-300x79.png 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<p>I understood that maybe the error was because the comment export file would be very huge as we intended to export nearly 30,000 comments! Maybe there was a better and more reliable way to export comments to Disqus.<\/p>\n<h3>WXR File Export Errors<\/h3>\n<p>The next best way to export comments from your WordPress blog to Disqus comments was to use the WordPress export feature to create a WordPress eXtended RSS or\u00a0WXR file, which could then be uploaded to Disqus. Go to <em>WordPress Admin&gt; Tools&gt; Export<\/em>. Choose to export all posts easily.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-29065\" title=\"WXR-export\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/WXR-export.png\" alt=\"WXR export file\" width=\"360\" height=\"365\" border=\"1\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/WXR-export.png 360w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/WXR-export-295x300.png 295w\" sizes=\"(max-width: 360px) 100vw, 360px\" \/><\/p>\n<p>But the WordPress export feature did not work as smoothly as expected. We downloaded the file and uploaded it to Disqus import, but the file would simply not import stating that it had errors.\u00a0We checked at the bottom of exported file and found the following error<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-29066\" title=\"PHP-execution-time\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/PHP-execution-time.png\" alt=\"PHP execution time\" width=\"500\" height=\"47\" border=\"1\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/PHP-execution-time.png 500w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/PHP-execution-time-300x28.png 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<p>The file creation timed out before the full file was created at 18MB.\u00a0We checked that WordPress only allowed <strong>maximum file execution time for 30 seconds<\/strong> everytime. There was a need to increase the PHP script execution time that WordPress would allow to let us create the WordPress export WXR file.<\/p>\n<p>So we added the following code to the <em>wp-config.php<\/em> file in the WordPress installation folder. This increased the execution time for generation of this WordPress export file to 60 seconds. You can increase the time further if your scripts are still timing out.<br \/>\n<code>ini_set(\"max_execution_time\", 60);<\/code><\/p>\n<p>This is a very important file which contains your important database information and passwords. Now the script was able to completely execute and we were able to successfully create the WordPress export file at over 40MB.<\/p>\n<h3>WXR file code errors<\/h3>\n<p>Now you need to upload this WXR file in the\u00a0Disqus comment import system.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-29069\" title=\"disqus-import\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/disqus-import.png\" alt=\"discuss import comments\" width=\"499\" height=\"327\" border=\"1\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/disqus-import.png 499w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/disqus-import-300x196.png 300w\" sizes=\"(max-width: 499px) 100vw, 499px\" \/><\/p>\n<p>Though the comments file uploaded successfully,\u00a0Disqus was still unable to process the file pending some errors.\u00a0The file showed the following XML syntax errors this time<\/p>\n<p><img decoding=\"async\" title=\"XML-error\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/XML-error.png\" alt=\"XML error\" width=\"500\" height=\"112\" border=\"1\" \/><\/p>\n<p>After 24 hours when\u00a0Disqus was still unable to process the file be contacted Disqus\u00a0support, and advised that the error occurs due to <strong>XML-invalid UTF-8 characters<\/strong> in the file. After fixing these errors, users are advised to re-import the files.<\/p>\n<p>Specifically, it is the first character (i.e., the first byte) in that list of four bytes that is the culprit. Although this character is a valid UTF-8 character, it is XML-invalid. In other words it cannot be used in XML files.<\/p>\n<p><strong> How to find the invalid characters?<\/strong><\/p>\n<p>Disqus support gave some very useful advice without which it was not possible to fix this file anyway. We had uploaded this file onto our server, and we logged on using <a href=\"http:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/\" target=\"_blank\" rel=\"noopener noreferrer\">Putty<\/a> to run the grep code on this xml file. grep is a command-line utility for searching data for matching a regular expression.<\/p>\n<p><code>grep --color='auto' -P -n \"[x00-x08]\" file.xml<\/code><br \/>\n<code>grep --color='auto' -P -n \"[x10-x1f]\" file.xml<\/code><\/p>\n<p>And we were able to find the offending error which was causing the problem.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-29070\" title=\"error-comment\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/error-comment.png\" alt=\"error comment\" width=\"500\" height=\"62\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/error-comment.png 500w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/error-comment-300x37.png 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<p>So we searched for the comment on WordPress, deleted the comment (someone had used short code in the comment), and re-exported the WordPress comment file and this time it should upload successfully and get processed hopefully.<\/p>\n<h3>\u00a0Imported comments error<\/h3>\n<p>Though the file uploaded successfully, the panel stated that the comment file processing time was around 24 hours. In a few hours the comments started going online and we enabled the\u00a0Disqus comments from the WordPress admin panel, which automatically replaced our previous WordPress comments system. However, some comments errors still persisted &#8230;<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-29073\" title=\"comments-error\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/comments-error.png\" alt=\"comments error\" width=\"331\" height=\"123\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/comments-error.png 331w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/comments-error-300x111.png 300w\" sizes=\"(max-width: 331px) 100vw, 331px\" \/><\/p>\n<p>&#8230; and Disqus was able to to provide a detailed report on all the comments that failed to be imported. We searched for those comments in WordPress and deleted them as the all contained form of strange code.<\/p>\n<p>I hope that if you are experiencing similar errors in your Disqus commends installation, you would be able to fix them easily now. \u00a0Now you can try out the Disqus comment system live on the site right now. There is no doubt that Disqus provides an amazing commenting \u00a0system to increased interaction of your website community.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Want to fix WordPress export comments errors, and problems in Disqus import? Are you unable to replace Disqus Comments with&#8230;<\/p>\n","protected":false},"author":4,"featured_media":29073,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[6],"tags":[49,17],"class_list":["post-28893","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogging","tag-tutorials","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/28893","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/comments?post=28893"}],"version-history":[{"count":0,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/28893\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media\/29073"}],"wp:attachment":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media?parent=28893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/categories?post=28893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/tags?post=28893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}