Title: Copy as Markdown Button
Author: Jose Varghese
Published: <strong>June 17, 2026</strong>
Last modified: June 17, 2026

---

Search plugins

![](https://ps.w.org/copy-as-markdown-button/assets/banner-772x250.png?rev=3576358)

![](https://ps.w.org/copy-as-markdown-button/assets/icon-256x256.gif?rev=3576337)

# Copy as Markdown Button

 By [Jose Varghese](https://profiles.wordpress.org/josevarghese/)

[Download](https://downloads.wordpress.org/plugin/copy-as-markdown-button.1.0.2.zip)

 * [Details](https://wordpress.org/plugins/copy-as-markdown-button/#description)
 * [Reviews](https://wordpress.org/plugins/copy-as-markdown-button/#reviews)
 *  [Installation](https://wordpress.org/plugins/copy-as-markdown-button/#installation)
 * [Development](https://wordpress.org/plugins/copy-as-markdown-button/#developers)

 [Support](https://wordpress.org/support/plugin/copy-as-markdown-button/)

## Description

Copy as Markdown Button lets your visitors copy any post or page content as clean,
well-structured Markdown with a single click. It handles everything from headings
and tables to code blocks and nested lists – no extra tools or dependencies required.

**Placement & Auto-injection**

 * Automatically injects the button before or after the content on any combination
   of post types (posts, pages, and custom post types)
 * Shortcode `[copy_as_markdown]` for manual placement in any post, page, or widget
 * Gutenberg block available in the Widgets category – place it anywhere in the 
   block editor with per-block overrides for button text, size, and content selector
 * Exclude specific posts or pages from auto-injection by entering their IDs – shortcode
   and block placements are unaffected

**Button Customisation**

 * Choose button size: Small, Medium, or Large
 * Set custom background, text, and hover colours via colour pickers
 * Adjust corner radius from 0 px (square) to 50 px (pill)
 * Show or hide the copy icon alongside the button label
 * Customise the button label (default: “Copy as Markdown”) and the success confirmation
   text (default: “Copied!”)
 * Live preview in the settings panel updates instantly as you change style options

**Content Control**

 * Optionally prepend the post title as a Markdown H1 heading
 * Custom CSS selector to target a specific page element instead of the auto-detected
   content area
 * Exclude any elements from the Markdown output using CSS selectors (one per line)–
   useful for stripping ads, share buttons, comment sections, and related posts
 * Per-shortcode overrides for button text, size, content selector, and download
   button visibility

**Download Button**

 * Optional dropdown “Download as .md” button that saves the converted Markdown 
   as a `.md` file directly from the browser, named after the post slug
 * Appears alongside the copy button in a split-button dropdown
 * Can be force-enabled or force-disabled per shortcode instance using the `download`
   attribute

**Markdown URL Endpoint**

 * Enable a `.md.txt` URL endpoint so any post or page can be viewed as plain-text
   Markdown by appending `.md.txt` to its URL (e.g. `yoursite.com/your-post-slug.
   md.txt`)
 * The server converts the post HTML to Markdown and serves it as `text/plain` –
   useful for programmatic access, LLM ingestion, and content pipelines
 * Works with Elementor pages by using Elementor’s own renderer when available
 * Optional “View as Markdown” link in the button dropdown opens the plain-text 
   endpoint in a new tab
 * Customisable link label for the “View as Markdown” item

**HTML-to-Markdown Conversion**

The converter handles a wide range of HTML elements cleanly:

 * Headings (H1–H6), paragraphs, line breaks, and horizontal rules
 * Bold (`**`), italic (`*`), and strikethrough (`~~`) inline formatting
 * Hyperlinks with optional title attributes; images with alt text and titles
 * Fenced code blocks with language detection from the `language-*` CSS class
 * Inline code with backtick escaping
 * Blockquotes with proper `>` prefixing on every line
 * Ordered and unordered lists with full nested list support
 * Tables converted to GitHub-Flavored Markdown pipe tables
 * Figures with italicised captions
 * YouTube iframe embeds converted to `[Video](url)` Markdown links
 * Scripts, styles, navigation, and form elements are automatically stripped

**Accessibility & Performance**

 * ARIA labels, `role="status"` live region for screen-reader announcements after
   copy
 * Keyboard-navigable dropdown with `aria-expanded` and `role="menu"` semantics
 * Frontend CSS and JavaScript are only loaded on pages where the button will actually
   appear

## Screenshots

[⌊The Copy as Markdown button rendered on the frontend with copy, download, and 
view options.⌉⌊The Copy as Markdown button rendered on the frontend with copy, download,
and view options.⌉[

The Copy as Markdown button rendered on the frontend with copy, download, and view
options.

[⌊Display settings - configure which post types show the button and exclusion rules.⌉⌊
Display settings - configure which post types show the button and exclusion rules
.⌉[

Display settings – configure which post types show the button and exclusion rules.

[⌊Style settings - customise button size, colours, corner radius, and live preview.⌉⌊
Style settings - customise button size, colours, corner radius, and live preview
.⌉[

Style settings – customise button size, colours, corner radius, and live preview.

[⌊Content settings - control the content selector, title prepending, and element
exclusions.⌉⌊Content settings - control the content selector, title prepending, 
and element exclusions.⌉[

Content settings – control the content selector, title prepending, and element exclusions.

[⌊Usage settings - shortcode reference, Gutenberg block, and .md.txt endpoint options.⌉⌊
Usage settings - shortcode reference, Gutenberg block, and .md.txt endpoint options
.⌉[

Usage settings – shortcode reference, Gutenberg block, and .md.txt endpoint options.

## Blocks

This plugin provides 1 block.

 *   Copy as Markdown Adds a button that copies the page content to the clipboard
   as Markdown.

## Installation

 1. Upload the plugin folder to the `/wp-content/plugins/` directory, or install the
    plugin through the WordPress Plugins screen directly.
 2. Activate the plugin through the **Plugins** screen in WordPress.
 3. Go to **Settings > Copy as Markdown** to configure where and how the button appears.

## FAQ

### How do I place the button manually?

Use the shortcode `[copy_as_markdown]` in any post, page, or widget, or add the **
Copy as Markdown** block in the Gutenberg block editor.

### Can I copy only part of the page?

Yes. Use the **Content Element Selector** setting (or the `selector` shortcode attribute)
to target a specific CSS element. Leave it blank to let the plugin auto-detect the
content area.

### Can I override shortcode settings per instance?

Yes. The shortcode accepts `text`, `size`, `selector`, and `download` attributes.
For example: `[copy_as_markdown text="Export" size="large" selector=".post-body"
download="true"]`.

### Does it work with custom post types?

Yes. Any public post type is listed in the Display settings so you can enable auto-
injection for it.

### How do I hide the button on a specific post without disabling the whole post type?

Enter the post or page ID in the **Exclude Specific Pages / Posts** field under 
the Display tab. You can find the ID in the URL when editing the post: `?post=123`.

### What is the .md.txt endpoint?

When enabled, appending `.md.txt` to any post or page URL (e.g. `yoursite.com/my-
post.md.txt`) serves the full post content as plain-text Markdown. After enabling
it, visit **Settings > Permalinks** once to flush rewrite rules.

### Does it work with Elementor?

Yes. The Markdown URL endpoint detects Elementor and uses its own renderer to capture
the full built page content rather than the raw `post_content`.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Copy as Markdown Button” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ Jose Varghese ](https://profiles.wordpress.org/josevarghese/)

[Translate “Copy as Markdown Button” into your language.](https://translate.wordpress.org/projects/wp-plugins/copy-as-markdown-button)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/copy-as-markdown-button/),
check out the [SVN repository](https://plugins.svn.wordpress.org/copy-as-markdown-button/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/copy-as-markdown-button/)
by [RSS](https://plugins.trac.wordpress.org/log/copy-as-markdown-button/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.0.2

 * Added optional Download button that saves post content as a `.md` file directly
   from the browser.
 * Added `.md.txt` URL endpoint – append `.md.txt` to any post/page URL to view 
   it as plain-text Markdown.
 * Added “View as Markdown” dropdown link that opens the `.md.txt` endpoint in a
   new tab.
 * Added YouTube iframe support – embeds are converted to `[Video](url)` Markdown
   links.
 * Added Exclude by Post ID setting to suppress auto-injection on specific posts
   or pages.
 * Improved split-button dropdown UI for copy, download, and view actions.

#### 1.0.1

 * Fixed plugin review issues.

#### 1.0.0

 * Initial release.

## Meta

 *  Version **1.0.2**
 *  Last updated **5 hours ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 6.0 or higher **
 *  Tested up to **7.0**
 *  PHP version ** 7.4 or higher **
 * Tags
 * [button](https://wordpress.org/plugins/tags/button/)[content](https://wordpress.org/plugins/tags/content/)
   [copy](https://wordpress.org/plugins/tags/copy/)[export](https://wordpress.org/plugins/tags/export/)
   [markdown](https://wordpress.org/plugins/tags/markdown/)
 *  [Advanced View](https://wordpress.org/plugins/copy-as-markdown-button/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/copy-as-markdown-button/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/copy-as-markdown-button/reviews/)

## Contributors

 *   [ Jose Varghese ](https://profiles.wordpress.org/josevarghese/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/copy-as-markdown-button/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://superwebshare.com/donate)