I am BARRY HESS > Blog

Disabling Markdown in Your WordPress Comments

Sometimes I post things to this blog that are well documented elsewhere. During research I’ll Google a phrase without any immediate results. Then I’ll dig in a little more until I find what I’m looking for. Finally I’ll make a blog post with a title that mimics my Google search.

This is a mutually beneficial. Since I searched for such a phrase, there’s a reasonable chance that other folks are making the same search. And since I didn’t find anything appropriate with my search, there’s a reasonable chance a post with said phrase will float to the top of Google. So theoretically I help someone out while also climbing a Google niche. And often someone who arrives here will help me improve my technique.

I guess when I type it out it sounds more selfish than anything.

Get on with the Markdown!

Sorry about that. Here’s a little tip for you. It’s well documented, but slightly buried. If you’re using PHP Markdown to ease your blogging markup, you may have noticed that Markdown has also snuck into your comments. I guess this is fine unless your comments necessarily have a bunch of underscores, for instance.

From the Configuration section of PHP Markdown site:

By default, the Markdown plugin applies to both posts and comments on your WordPress weblog. To deactivate one or the other, edit the MARKDOWN_WP_POSTS or MARKDOWN_WP_COMMENTS definitions under the “WordPress setting” header at the start of the “markdown.php” file.

It’ll be obvious when you checkout markdown.php, but just to be complete:

# Change to false to remove Markdown from posts and/or comments.
@define( 'MARKDOWN_WP_POSTS',      true );
@define( 'MARKDOWN_WP_COMMENTS',   false );