Markdown nofollow recipes Astro
Add rel="nofollow" to one link in Astro Markdown
Write the link as an inline <a> tag with rel="nofollow". Astro
7's default Markdown processor keeps inline HTML, so the attribute reaches the built page.
- Astro 7.4.8
- Sätteri 0.11.7, Astro 7's default Markdown processor
- Node.js 24.1.0
- Built on 10 November 2026
Write the link, then build
Put the tag in the sentence where the link belongs. The Markdown around it stays Markdown.
You write
src/pages/blog/retry-failed-jobs.md Record the job ID, attempt number and error. Keep the entries consistent. Logsift's <a href="https://logsift.example/guides/job-logs" rel="nofollow">guide to structured job logs</a> shows a format you can search later.
The build wrote
dist/blog/retry-failed-jobs/index.html <p>Record the job ID, attempt number and error. Keep the entries consistent. Logsift’s <a href="https://logsift.example/guides/job-logs" rel="nofollow">guide to structured job logs</a> shows a format you can search later.</p>
Astro's smart punctuation turned the apostrophe in Logsift's into a curly one. The link attributes came through as written.
For comparison, the same page has a plain Markdown link to the same guide. The build wrote it like this:
dist/blog/retry-failed-jobs/index.html <p>Plain Markdown link: <a href="https://logsift.example/guides/job-logs">guide to structured job logs</a>.</p>
Markdown link syntax, [text](url), has nowhere to put a rel, so
the plain link has none.
Gotcha
Don't open a paragraph with the tag on its own line
In CommonMark, a line that holds only a complete open tag starts a raw HTML block when it
opens a paragraph. Everything up to the next blank line then goes through as HTML. The link
survives, but the rest of the paragraph loses its Markdown: there's no
<p>, and **search later** stays as literal asterisks.
Keep the tag inside a line of text, as in the recipe above. The second paragraph in the test file does that, and it built normally.
You write
src/pages/blog/html-block-gotcha.md <a href="https://logsift.example/guides/job-logs" rel="nofollow"> Logsift's guide</a> shows a format you can **search later**. Logsift's <a href="https://logsift.example/guides/job-logs" rel="nofollow">guide</a> shows a format you can **search later**.
The build wrote
dist/blog/html-block-gotcha/index.html <a href="https://logsift.example/guides/job-logs" rel="nofollow"> Logsift's guide</a> shows a format you can **search later**. <p>Logsift’s <a href="https://logsift.example/guides/job-logs" rel="nofollow">guide</a> shows a format you can <strong>search later</strong>.</p>
Check the built page before you merge
Run this against the built file. The output below is what the command printed for the test project.
The test page has both links, so the command prints two tags. Only the first has
rel="nofollow".
To see every outside link on a page with its anchor text and rel value, paste
the built file into the built HTML link audit. It runs in your
browser and uploads nothing.
grep -o '<a [^>]*logsift[^>]*>' dist/blog/retry-failed-jobs/index.html
<a href="https://logsift.example/guides/job-logs" rel="nofollow"> <a href="https://logsift.example/guides/job-logs">
Sources and what was tested
The test project is one Markdown page with one paragraph, built locally with the versions listed at the top. Every HTML excerpt on this page is copied from that build without edits. Other versions, and plugins that rewrite links, can build different HTML, so check your own output.
Using another generator? See all six recipes.
Next steps with LinkBunny
Placing a LinkBunny exchange link?
LinkBunny exchange links must use nofollow. Your coding agent can follow this
recipe when it places one, and the first exchange is free for one site.
After the deploy, check the live page
LinkBunny's nofollow link checker fetches a public page and lists each link on it with its
rel value, so you can confirm the link survived the deploy.