Jeff Owens.com
Logo
Jeff Owens.com

Ghost Comments With Disqus.com

Disqus.com Comment Engine

This is part four in a series of blog posts on migrating a Wordpress blog to Ghost.

Since Ghost doesn't have a Comment engine it becomes necessary to find a third-party alternative for hosting them. Disqus.com is the free website I used to move over my Wordpress comments to my new Ghost blog.

First signup for a new account.

Disqus.com Sign-Up Form

After logging into Disqus you can create a unique Disqus URL for your blog's comments.

Create your Disqus Comment URL

Next log into your Wordpress blog and go to Plugins. Search for the Disqus plugin and login to the plugin using your Disqus credentials. Go ahead and export your comments into Disqus.

Once Disqus has finished importing all of your comments you must do an additional step before you can add them to your Ghost blog. Unfortunately the URL structure that Wordpress implements is slightly different than what Ghost uses. Wordpress can support different URL schemes such as prepending the date or category before the slug of a page. Here is an example Wordpress URL that has a category before the slug: https://www.myblog.com/some-category/your-blog-post-name. Ghost doesn't support categories. It will just use the name of the post like so: https://www.myblog.com/your-blog-post-name. So in order for your Disqus comments to show up on a blog post's page, it is necessary to update all of the URL's to what Ghost uses. Fortunately Disqus provides a method of doing just that with one of their Migration Tools.

Disqus Migration Tools

Disqus has a URL Mapper that allows you to upload a CSV file with the old and new URL mappings.

Disqus URL Mapper

Here is an example CSV file with the old URLs in the first column and the matching new ones in the second column.

Disqus CSV File

You first download your CSV file from Disqus. The CSV will contain just one column. The current URL structure that imported from the Wordpress column. Simply add your new URL mapping for each blog post into a second column. Save the CSV file and upload it to Disqus. You now have the correct mappings that Ghost can use to show the correct Comment thread for a matching blog post URL.

Upload CSV File

The last thing you need to do is to tell Ghost about your Disqus comments. To do that you need to go into your themes post.hbs file and edit it (for example: content/themes/casper/post.hbs). Find the closing article HTML tag and paste in the Disqus JavsScript they provide for universal blogs. You can find the script by going to Admin/Settings:

https://your-username.disqus.com/admin/settings/universalcode/

Make sure to add your unique "Disqus shortname" to the JavaScript so it will find your blog's comments.

That's it, you now have your comments successfully migrated from Wordpress to Disqus.

This concludes part four. Part five of the series focuses on moving your Wordpress images to Cloudinary.com and adding them to your Ghost blog.