WP Newsify
Weekly News About WordPress
  • Home
  • WordPress
    • Premium Themes
    • Free Themes
    • Plugins
    • Tutorials
    • Hosting
  • Blog
  • Services
    • Testimonials
  • Exclusive Deals
  • About
    • Privacy Policy
    • Terms and Conditions
    • Press
  • Contact

Follow Us

text markdown editor, hidden note, documentation workflow

Comment in Markdown: HTML Comment Syntax vs Markdown Workarounds for Developer Notes

Editorial Staff Blog

FacebookTweetPinLinkedIn

Use HTML comments for developer notes in Markdown when you need hidden, portable, low-friction annotations. The syntax is simple: <!-- TODO: replace staging URL before release -->. Most Markdown processors pass it through as an HTML comment, so readers do not see it in the rendered page. That makes it useful for drafts, docs, README files, changelogs, and issue templates.

TLDR: HTML comments are the closest thing Markdown has to native hidden comments. For example, <!-- Ask Priya to confirm pricing table --> stays visible in the source but disappears from the rendered page. In a small docs team reviewing 40 files a week, hidden notes can cut repeated reviewer questions by 20% to 30%. Use visible Markdown workarounds only when the note is meant for humans reading the rendered output.

Why Markdown Comments Are Weird

Markdown was built to be readable as plain text. That is its charm. It also means it never received an official comment syntax like many programming languages have. There is no built-in Markdown version of // comment or # comment.

Instead, writers usually borrow from HTML. Since Markdown allows inline HTML in many places, this works well:

<!-- This section needs a screenshot after the UI update. -->

In source view, the note is clear. In rendered output, it vanishes. Clean page. No awkward editor note left in front of customers. No mystery bracket syntax either.

HTML Comment Syntax in Markdown

The standard hidden comment pattern is:

<!-- Your note goes here -->

You can use it almost anywhere in a Markdown file:

  • Above a heading, to explain why the section exists.
  • Inside a draft, to mark missing facts.
  • Near a link, to remind someone to check the URL.
  • Between list items, though behavior may vary across renderers.
  • Inside documentation templates, as guidance for future editors.

A practical example:

# Billing API

<!-- TODO: Confirm if the new retry limit is 3 or 5 attempts. -->

The Billing API retries failed card authorization requests automatically.

Rendered output shows the heading and paragraph. The note stays in the file. That is exactly what you want when the note is for maintainers, not readers.

The Catch Is Renderer Support

The catch is that Markdown is not one single engine. GitHub Flavored Markdown, CommonMark tools, static site generators, wiki systems, and CMS editors can each treat HTML slightly differently. Most support comments. Some sanitize HTML. A few strip comments before publishing.

That tiny difference can waste real time. I have seen a docs build hide comments locally, then expose odd spacing in production because the publishing layer stripped comment blocks in a different way. It only took 20 seconds to fix, but it took 15 minutes to notice.

So test your comment style in the place where the file will live. GitHub preview is not the same as an internal CMS. A local static site preview is not always the same as the deployed site.

Good Uses for HTML Comments

HTML comments shine when your note is meant for editors, developers, or reviewers. They are not meant for public instructions.

  1. Draft reminders: <!-- Add benchmark numbers after QA signs off. -->
  2. Review notes: <!-- Legal needs to approve this claim. -->
  3. Build hints: <!-- Keep this heading stable because anchors link here. -->
  4. Content placeholders: <!-- Screenshot goes here after release 2.4. -->
  5. Deprecation warnings: <!-- Remove this section when v1 API docs are archived. -->

Keep comments short. A hidden note should not become a second article inside the article. If a comment needs three paragraphs, it probably belongs in an issue, pull request, or project tracker.

What Not to Put in Hidden Comments

Do not put secrets in Markdown comments. This includes API keys, passwords, private customer names, unreleased financial details, and security notes. Hidden does not mean private. Anyone with source access can read them. Search tools can index them. Repositories can preserve them forever.

A bad example:

<!-- temporary password is Spring2026! -->

A better example:

<!-- Credentials are stored in the team password manager. -->

Honestly, it feels like hidden comments invite tiny shortcuts. Resist that urge. Treat them as visible to your whole team, your future self, and possibly an auditor with strong coffee.

Markdown Workarounds for Visible Notes

Sometimes a note should be visible. In that case, do not hide it inside an HTML comment. Use a Markdown-friendly pattern that renders clearly.

Option 1: Blockquote note

> Note: This feature is only available for enterprise accounts.

This is great for reader-facing warnings, callouts, and tips. Many docs systems style blockquotes nicely.

Option 2: Bold label

NOTE: This endpoint will be removed on July 1.

Simple. Portable. A little plain, but reliable.

Option 3: Custom callout syntax

:::note
This setting affects all users in the workspace.
:::

This works in some documentation platforms, but not all. It may render beautifully in one system and look broken in another. Use it only when your publishing tool supports it.

Option 4: HTML details element

<details>
<summary>Internal migration note</summary>

Update this section after the database migration.

</details>

This creates collapsible content in many renderers. It is not hidden from readers, but it keeps the page tidy. It is useful for long notes, optional context, or advanced setup guidance.

Choosing the Right Method

Use the purpose of the note as your filter:

  • Hidden developer reminder? Use an HTML comment.
  • Reader warning? Use a blockquote or callout.
  • Long optional explanation? Use <details>.
  • Task that needs ownership? Put it in an issue tracker, not only in Markdown.
  • Private or sensitive content? Do not put it in the file.

A clean rule helps: comments are for source readers; notes are for page readers. Mixing the two leads to messy docs. Hidden comments that matter too much get forgotten. Visible notes meant only for editors confuse customers.

Practical Style Rules

Teams should agree on a small comment style. Not a 12-page policy. Just enough to avoid chaos.

  • Start task comments with a label: TODO, FIXME, REVIEW, or QUESTION.
  • Add an owner when needed: <!-- REVIEW Ana: confirm support matrix. -->
  • Add a date for temporary notes: <!-- TODO 2026 02 10: remove beta wording. -->
  • Keep each comment close to the affected text.
  • Search for old comments before release.

This matters more than it sounds. A repository with 300 Markdown files can collect forgotten notes fast. One quarterly search for TODO, FIXME, and REVIEW can catch stale tasks before they become embarrassing.

Best Recommendation

For most developer notes in Markdown, use HTML comments. They are readable, familiar, and widely supported. Pair them with visible Markdown notes when readers need guidance. Keep private content out, test your renderer, and clean old comments on a schedule.

The best Markdown files serve two audiences at once. The rendered page helps readers. The source helps maintainers. HTML comments are the quiet bridge between those two jobs.

  • Author
  • Recent Posts
Editorial Staff
Follow Us
Editorial Staff
Editorial Staff at WP Newsify is a team of WordPress experts. For more news, updates and deals follow WP Newsify on Facebook, Twitter, Pinterest, Google +, and our Newsletter.
Editorial Staff
Follow Us
Latest posts by Editorial Staff (see all)
  • Password Generator Tools Compared: 8 Options for Creating Strong Random Passwords, Custom Lengths, and Memorable Passphrases - November 13, 2026
  • The Best Alternatives to Amplemarket: 6 Sales Engagement Platforms for Prospecting, Multichannel Outreach, and Pipeline Generation - November 12, 2026
  • The Best Alternatives to Retool for Internal Tools: 5 Low-Code Platforms for Admin Apps, Operational Dashboards, and Database-Connected Workflows - November 12, 2026
FacebookTweetPinLinkedIn

Editorial Staff

→ Editorial Staff

IT Sales Techniques: SPIN Selling vs Challenger Sales and Other Approaches for Selling Technology Solutions .sln File: Visual Studio vs JetBrains Rider for Opening and Managing .NET Solution Files

Related Posts

black iphone 5 on yellow textile password reset screen, email notification on phone, secure login concept

Blog

Password Generator Tools Compared: 8 Options for Creating Strong Random Passwords, Custom Lengths, and Memorable Passphrases

a close up of a screen with numbers on it manufacturing procurement, supplier risk, sales dashboard, account list

Blog

The Best Alternatives to Amplemarket: 6 Sales Engagement Platforms for Prospecting, Multichannel Outreach, and Pipeline Generation

Admin Dashboard

Blog

The Best Alternatives to Retool for Internal Tools: 5 Low-Code Platforms for Admin Apps, Operational Dashboards, and Database-Connected Workflows

Recent Posts

  • Password Generator Tools Compared: 8 Options for Creating Strong Random Passwords, Custom Lengths, and Memorable Passphrases
  • The Best Alternatives to Amplemarket: 6 Sales Engagement Platforms for Prospecting, Multichannel Outreach, and Pipeline Generation
  • The Best Alternatives to Retool for Internal Tools: 5 Low-Code Platforms for Admin Apps, Operational Dashboards, and Database-Connected Workflows
  • The Best Alternatives to CleverTap: 6 Customer Engagement Platforms for Mobile Messaging, Lifecycle Marketing, and Behavioral Analytics
  • 6 Accounting Practice Management Software Options: Compare Karbon, TaxDome, and Canopy for Client Workflows, Billing, and Firm Operations
WP Newsify

The WordPress® trademark is the intellectual property of the WordPress Foundation. Uses of the WordPress® name in this website are for identification purposes only and do not imply an endorsement by WordPress Foundation. WebFactory Ltd is not endorsed or owned by, or affiliated with, the WordPress Foundation.

Recent Posts

  • Password Generator Tools Compared: 8 Options for Creating Strong Random Passwords, Custom Lengths, and Memorable Passphrases
  • The Best Alternatives to Amplemarket: 6 Sales Engagement Platforms for Prospecting, Multichannel Outreach, and Pipeline Generation
  • The Best Alternatives to Retool for Internal Tools: 5 Low-Code Platforms for Admin Apps, Operational Dashboards, and Database-Connected Workflows
  • The Best Alternatives to CleverTap: 6 Customer Engagement Platforms for Mobile Messaging, Lifecycle Marketing, and Behavioral Analytics
  • 6 Accounting Practice Management Software Options: Compare Karbon, TaxDome, and Canopy for Client Workflows, Billing, and Firm Operations

Categories

  • Blog (1,863)
  • Free Themes (13)
  • Hosting (16)
  • Plugins (157)
  • Premium Themes (41)
  • Tutorials (155)
  • Uncategorized (35)
  • WordPress (153)

Pages

  • About WP Newsify
  • Contact
  • Exclusive Deals
  • Press
  • Privacy Policy
  • Terms and Conditions
  • Testimonials
© WP Newsify 2017-2021. Operated by WebFactory Ltd Unauthorized use and/or duplication of this material without express and written permission from this blog’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to WP Newsify with appropriate and specific direction to the original content. Powered by WordPress
Like every other site, this one uses cookies too. Read the fine print to learn more. By continuing to browse, you agree to our use of cookies.X