Choosing the right Markdown plugin to use with WordPress

Markdown with WordPress can be a little tricky to get right. Ideally you want to write your post in Markdown. Then publish it, yet keep the original Markdown source for future edits.

Somewhere in this process the Markdown should be converted to HTML, so that visitors to that post should see the generated HTML, and not the Markdown source. But you don’t want to do this manually every time you create or edit a post!

One approach is to write the Markdown source code to the database and generate Markdown just before showing it to the visitor. However, This approach has major performance penalties, as the server is needlessly converting Markdown to HTML on every request.

Another approach is to generate HTML from Markdown after publishing and converting it back to Markdown while editing. This avoids the performance penalties of generating Markdown on every visit by a user.

But doing so means if you ever decide to deactivate or remove the plugin you end up loosing the original markdown content.

A better approach to this problem is to store the original Markdown in a separate field in the database. Now you have your Markdown source preserved even after you disable or delete the plugin.

The recently added Markdown plugin to JetPack does exactly this. The author Matt Wiebe has also released, Markdown on Save Improved, a version for use with self-hosted WordPress without JetPack.

Both plugins support most of the Markdown syntax without issues. Additionally the JetPack plugin even supports GitHub style fenced code blocks.

If you have never used Markdown before give these plugins a spin. Both provide for a very natural and efficient writing environment in WordPress.