How to delete discussion threads with incorrect URL in Disqus
The first time Disqus is loaded on a website page, the Disqus system automatically creates a new discussion thread and associates that discussion with the URL of the page used during that first load. This is an incredibly simple, user-friendly solution. However, there is a downside of automatically created discussion threads. Recently, in my Disqus Admin area, I noticed that there are many discussion threads that are a mistake because they contain incorrect URLs. In this tutorial, I will show you how I got rid of my website’s discussion threads with incorrect URL.
In my case there are a lot of discussion threads with incorrect URL. To be more exact, from 1239 URLs 850 are incorrect, and only 397 are correct. Most of the URLs are 127.0.0.1
(this is my localhost) and translate.googleusercontent.com
which is a Google Translator.
Let’s begin
Unfortunately, in the Disqus Admin area, there is no button to directly delete the discussion threads. However, we have the opportunity to get rid of unwanted discussion threads. We can merge all the discussion threads with incorrect URL into one thread, and attach this discussion to the “404” page of our website. The process of merging of discussion threads is a really easy process. Now, step by step guide.
Get a list of all URLs
First, we need to get a list of all discussion threads (only their URLs) of our website. To do this, we can use the URL mapper tool available in our Disqus Admin area.
- Log in to your Disqus account.
- Once logged in Disqus, click on the
Admin
in the upper right corner of the page. You will be taken to your Disqus Admin area.
- Select a site from the
Your Sites
list in the top navigation bar.
- Click on the
Community
in the top navigation bar.
- Select the
Migration Tools
menu item on the left side of the Disqus Admin interface.
- Click on the
Start URL mapper
button.
- Click on the
download a CSV here
button to download a file which will contain list of all discussion threads (only their URLs).
Edit the list of all URLs
Once we get the file containing a list of all discussion threads (only their URLs) of our website, we can begin to edit it.
-
Open the file obtained in the step 1 in a text editor. As a text editor, I use the TextEdit app, but you can use any other editor.
- Delete all lines with the correct URL. Since we are not going to change the correct URLs then this time we do not need them.
Note! There should be left only the lines with the incorrect URL corresponding to the discussion thread that we want to delete from Disqus. Do not confuse :)
- To each line remaining in the file add (comma separated) an additional URL that lead to the page
404
of your website. The correct format is the following:http://example.com/wrong-post-url-a.html, http://example.com/404.html http://example.com/wrong-post-url-b.html, http://example.com/404.html http://example.com/wrong-post-url-c.html, http://example.com/404.html
Do not forget to replace
http://example.com/404.html
with the actual URL of your website’s 404 page. - Save the changes made to the file.
Submit the list of changed URLs
Now we are ready to submit our file of corrected URLs to Disqus. This step almost completely repeats the step 1.
-
Return to the Disqus website and navigate to your Disqus Admin area.
-
Select a site from the
Your Sites
list in the top navigation bar.
- Click on the
Community
in the top navigation bar.
- Select the
Migration Tools
menu item on the left side of the Disqus Admin interface.
- Click on the
Start URL mapper
button.
- Click on the
Choose File
button to choose the file that you obtained in the step 2.
- Click on the
Next Step
button. A page showing the URL map will be displayed.
- Click on the
Submit Migration
button to submit the file.
Optional
To prevent incorrect links from appearing in the future, we can configure trusted domains by following these instructions.
We can delete the comments themselves (if they exist) on the 404 page of our website by following these instructions. We will need to delete them individually, from https://yoursite.disqus.com/admin/moderate/#/all
(replace yoursite
with your website slug). Since we merged all discussion threads with incorrect URL into one thread, they are easy to find and delete.
We can also close the discussion thread of the 404 page by going to https://yoursite.disqus.com/admin/discussions/
(replace yoursite
with your website slug) and clicking on the lock symbol.
Conclusion
That’s it, you’re done. Now you have the discussion threads with incorrect URL deleted. So simple isn’t it?
Once the file is submitted, Disqus will start merge immediately. After a few hours (merging can take up to 24 hours to finish), you can confirm that the discussion threads with incorrect URL are deleted by browsing to your Disqus Admin area and downloading a CSV file again (as in step 2 of this article). Any discussion thread you want to delete in the future, just merge into http://example.com/404.html
.
I hope this article has helped you learn how to delete discussion threads with incorrect URL. If this article has helped you then please leave a comment
Thanks for reading!
Arthur is a designer and full stack software engineer. He is the founder of Space X-Chimp and the blog My Cyber Universe. His personal website can be found at arthurgareginyan.com.