In Markdown that allows HTML, write a comment as <!-- author note -->. Browsers do not display that comment as page text, but it can remain in the source or generated HTML. A Markdown comment is not a safe place for credentials, private customer details, or anything that must not be published.
1## Restore an archived project2
3<!-- Editorial: verify the menu label before release. -->4
5Open the archive and select the project to restore.The reader sees the heading and instruction, not the editorial note. The author or anyone with access to the source can still read the note.
Single-line and multiline comments
The same delimiters can surround several lines:
1<!--2Editorial review3Owner: documentation team4Check: confirm the archive menu label5-->Place a block comment between paragraphs with blank lines around it. This makes its boundaries easier to review and reduces surprises when nearby Markdown is parsed as part of an HTML block.
Do not nest HTML comments. An inner closing delimiter can end the outer comment earlier than intended. Keep the content plain, avoid embedded comment delimiters, and make the opening and closing markers easy to locate.
The CommonMark HTML-block rules describe how comments enter the parsed document. A publishing pipeline may preserve them, strip them, or reject raw HTML entirely. The authoring syntax alone cannot establish what reaches the final page.
What "hidden" actually means
Review visibility at several different layers:
| Layer | Can the note still be present? | What to inspect |
|---|---|---|
| Markdown repository | Yes | The file and its history |
| Generated HTML | Yes, unless removed | Page source or build output |
| Browser's normal visual page | Usually not displayed | The published page |
| Export, search, or ingestion pipeline | Depends on the parser | The actual exported or indexed content |
If the note says "remove the old credential before launch," the right action is to remove and rotate the credential, not wrap it in a comment. Deleting a published secret from the current file also does not erase repository history or previous artifacts.
For a public article, keep editorial comments free of sensitive information even when your current build strips them. The file may be reused by a different tool later.
MDX uses JSX comments
MDX is not simply Markdown with every HTML behavior unchanged. In MDX content, use a JSX comment expression:
1## Restore an archived project2
3{/* Editorial: verify the menu label before release. */}4
5Open the archive and select the project to restore.An HTML comment can produce an MDX compilation error. The MDX syntax documentation explains that MDX combines Markdown with JSX and JavaScript expressions. Do not blindly copy comment syntax from a README into an .mdx page.
JSX comment syntax also is not a security boundary. The note still exists in the MDX source even if the rendered component does not output it. Keep the same source-review policy for both formats.
Inside fenced code, neither spelling hides anything: it becomes visible example text. That is useful in a syntax tutorial but wrong if the intention is an invisible author note. See code blocks for how fences prevent Markdown interpretation.
Avoid link-reference tricks for editorial notes
You may encounter patterns such as:
1[comment]: # (Review the archive label)This resembles a link reference definition. It is not a dedicated Markdown comment feature. If the parser accepts the definition, it can create a reference named comment; using that reference elsewhere can produce a link. Small changes to the syntax may instead make the text visible.
Use reference definitions for reference-style links, not as an undocumented note-storage system. An explicit HTML comment in plain Markdown, or a JSX comment in MDX, communicates intent more clearly to the next editor.
An editorial workflow that does not rely on hidden text
For a note that must be resolved before publication, give it a tracked home. A review issue or private editorial task is usually better than a comment that silently survives for months.
If you do keep harmless source notes, use a small review convention:
1Editorial note review21. Search the source for comment delimiters.32. Resolve notes tied to this release.43. Remove stale discussion and temporary alternatives.54. Build the actual publication format.65. Check page source and exported text where relevant.Search for both <!-- and {/* if the content collection includes Markdown and MDX. Search the source, not only the visual preview: a hidden note can pass a visual review precisely because it is hidden.
When the information belongs to the reader, make it visible. A prerequisite, warning, or recovery instruction should be ordinary prose or a clearly labeled callout, not an author-only comment.
FAQ
Is there a standard Markdown comment character?
There is no dedicated core Markdown comment marker. HTML comments are a common approach when the renderer permits HTML; MDX uses JSX comments instead.
Can visitors read my Markdown comments?
They may be able to read them in public source files or generated HTML. Normal visual hiding does not make the contents private.
Why does an HTML comment break an MDX page?
MDX parses HTML-like content as JSX rather than accepting every raw HTML construct. Use a JSX comment expression and compile the page in the actual MDX pipeline.